Gateway processing

ABSTRACT

A gateway for use in a computing system to interface a host with the subsystem for acting as a work accelerator to the host, the gateway having an streaming engine for controlling the streaming of batches of data into and out of the gateway in response to pre-compiled data exchange synchronisation points attained by the subsystem, wherein the streaming of batches of data is selectively via at least one of an accelerator interface, a data connection interface, a gateway interface and an memory interface, wherein the streaming engine is configured to perform data preparation processing of the batches of data streamed into the gateway prior to said batches of data being streamed out of the gateway, wherein the data preparation processing comprises at least one of: data augmentation; decompression; and decryption.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present application claims priority to United Kingdom PatentApplication No. 1904634.1, filed Apr. 2, 2019 and United Kingdom PatentApplication No. 1811016.3, filed Jul. 4, 2018, of which are herebyincorporated by reference in their entirety as if full see forth belowand for all applicable purposes.

TECHNICAL FIELD

The present disclosure relates to a gateway for use in a computer systemto interface a host with a subsystem for acting as a work accelerator,and in particular to the provision and preparation of data.

BACKGROUND

In the context of processing data for complex or high volumeapplications, a work accelerator may be a subsystem to which processingof certain data is offloaded from a host system. Such a work acceleratormay have a specialised hardware for performing specific types ofprocessing.

As an example, one area of computing in which such a specialisedaccelerator subsystem may be of use is found in machine intelligence. Aswill be familiar to those skilled in the art of machine intelligence, amachine intelligence algorithm is based around performing iterativeupdates to a “knowledge model”, which can be represented by a graph ofmultiple interconnected nodes. The implementation of each node involvesthe processing of data, and the interconnections of the graph correspondto data to be exchanged between the nodes. Typically, at least some ofthe processing of each node can be carried out independently of some orall others of the nodes in the graph, and therefore large graphs exposegreat opportunities for multi-threading. Therefore, a work acceleratorspecialised for machine intelligence applications may comprise a largedegree of multi-threading. One form of parallelism can be achieved bymeans of a processor comprising an arrangement of multiple tiles on thesame chip (i.e. same die), each tile comprising its own separaterespective processing unit and memory (including program memory and datamemory). Thus separate portions of program code can be run in parallelon different ones of the tiles. The tiles are connected together via anon-chip interconnect which enables data to be exchanged between them.Such an accelerator may function as a subsystem for a host system toperform parallel processing of data sets provided to it.

In general, there may exist dependencies between the portions of aprogram running on different tiles. A technique is, therefore requiredto prevent a piece of code on one tile running ahead of data upon whichit is dependent being made available by another piece of code on anothertile. There are a number of possible schemes for achieving this, one ofwhich is described here by way of example, ‘BSP’, bulk synchronousparallel. According to BSP, each tile performs a compute phase and anexchange phase in an alternating cycle. During the compute phase eachtile performs one or more computation tasks locally on tile, but doesnot communicate any results of its computations with any others of thetiles. In the exchange phase each tile is allowed to exchange one ormore results of the computations from the preceding compute phase toand/or from one or more others of the tiles in the group, but does notyet proceed to the next compute phase. Further, according to the BSPprinciple, a barrier synchronization is placed at the juncturetransitioning from the compute phase into the exchange phase, ortransitioning from the exchange phase into the compute phase, or both.That is to say, either: (a) all tiles are required to complete theirrespective compute phases before any in the group is allowed to proceedto the next exchange phase, or (b) all tiles in the group are requiredto complete their respective exchange phases before any tile in thegroup is allowed to proceed to the next compute phase, or (c) both. Insome scenarios, a tile performing computation may be allowed tocommunicate with other system resources such as a network card orstorage disk, as long as no communication with other tiles in the groupis involved.

During an exchange phase, data exchange may not only take placeinternally (i.e. between tiles) within an accelerator, but in somecircumstances may be required to take place between an accelerator andexternal storage, e.g. a host system. When a subsystem acts as a workaccelerator, it is configured to process data sets provided to it (e.g.from a host system). The data sets should be prepared such that they areavailable for processing by the accelerator at an appropriateprecompiled data exchange synchronisation point, which may represent abarrier synchronisation.

When scaling subsystems by connecting them together—directly orindirectly—a problem may occur, which is that the resources availablefor fetching the data from storage and delivering it to workaccelerators may be exceeded. For example, preparing and storing all ofthis data at a host machine to then deliver the data to the acceleratorsubsystem may exceed the storage and processing capacity of the hostsystem. Furthermore, preparing and storing all of this data at such anexternal storage may present a security risk.

SUMMARY OF THE INVENTION

The present invention uses the concept of a gateway which can be used toprovide data to the accelerators from external storage and thusinterconnect them to scale a subsystem acting as a work accelerator. Theaccelerator receives the data from the gateway in an exchange phase andcomputes the data in a following compute phase. In some forms of thegateway, the gateway itself is an active processor of data andautonomously manages its data flows. The gateway acts as an intermediarybetween external storage and one or more accelerators. The gateway has alocal memory for temporarily storing data for delivery to theaccelerator from the external storage.

The gateway is configured to perform data preparation operations on datait receives for delivery to one or more accelerators. The gateway isconfigured to interpret and modify the data for use by the one or moreaccelerators. The data preparation operations may be performed bysoftware running on the gateway, by specialised hardware of the gatewayor by a combination of such software and hardware.

According to a first aspect, there is provided a gateway for use in acomputing system to interface a host with the subsystem for acting as awork accelerator to the host, the gateway having: an acceleratorinterface for connection to the subsystem to enable transfer of batchesof data between the subsystem and the gateway; a data connectioninterface for connection to external storage for exchanging data betweenthe gateway and storage; a gateway interface for connection to at leastone second gateway; a memory interface connected to a local memoryassociated with the gateway; and a streaming engine for controlling thestreaming of batches of data into and out of the gateway in response topre-compiled data exchange synchronisation points attained by thesubsystem, wherein the streaming of batches of data are selectively viaat least one of the accelerator interface, data connection interface,gateway interface and memory interface, wherein the streaming engine isconfigured to perform data preparation processing of the batches of datastreamed into the gateway prior to said batches of data being streamedout of the gateway, wherein the data preparation processing comprises atleast one of: data augmentation; decompression; and decryption.

In some embodiments, the streaming engine comprises at least oneprocessor configured to perform the data preparation processing.

In some embodiments, the at least one processor is configured to executecomputer-readable instructions stored in a memory of the gateway toperform at least some of the data preparation processing.

In some embodiments, the data preparation processing comprises at leastone of: data augmentation; decompression; and decoding.

In some embodiments, the external storage is at least one of: a host;and a remote storage.

In some embodiments, the performing data preparation processing of thebatches of data comprises performing data preparation processing of datareceived from the external storage prior to said data being provided bythe gateway to the subsystem.

In some embodiments, the performing data preparation processing of thebatches of data comprises performing preparation processing of datastreamed into the gateway prior to said data being provided by thegateway to the at least one second gateway.

In some embodiments, the performing data preparation processing of thebatches of data comprises performing preparation processing of datareceived from the at least one second gateway prior to said data beingstreamed out of the gateway.

In some embodiments, the streaming engine is configured to: process aset of data received at the gateway to produce a plurality of sets ofdata; apply data preparation operations to each of the plurality of setsof data with different settings applied for different ones of theplurality of sets of data to produce a plurality of prepared sets ofdata; and cause each of the plurality of prepared sets of data to betransferred to a different one of a plurality of subsystems for actingas work accelerators to the host.

In some embodiments, the processing the set of data received at thegateway to produce the plurality of sets of data comprises at least oneof: replicating the received set of data, wherein each of at least someof the plurality of sets of data is a copy of the received set of data;and sharding the received set of data, wherein each of at least some ofthe plurality of sets of data is a subset of the received set of data.

In some embodiments, wherein the accelerator interface is configured toconnect the gateway to at least some of the plurality of subsystems toenable transfer of batches of data between the gateway and the at leastsome of the plurality of subsystems, wherein the causing each of theplurality of prepared sets of data to be transferred to different onesof the plurality of subsystems comprises providing at least one of theprepared sets of data to the accelerator interface to be transferred tothe at least some of the plurality of subsystems.

In some embodiments, the causing of each of the plurality of preparedsets of data to be transferred to different ones of the plurality ofsubsystems comprises providing at least one of the prepared sets of datato the gateway interface to be transferred to the at least one secondgateway, the at least one second gateway being configured to interfacewith at least one of the plurality of subsystems.

In some embodiments, applying the data preparation operations withdifferent settings applied comprises applying different types of dataaugmentation.

In some embodiments, applying the data preparation operations withdifferent setting applied comprises applying the same type of dataaugmentation with different parameters for the augmentation.

In some embodiments, the streaming engine comprises at least onehardware module configured to perform at least some of the datapreparation processing of the data.

In some embodiments, the at least one hardware module comprises aplurality of hardware modules each of which is configured to perform adifferent type of data preparation processing.

In some embodiments, the at least one hardware module comprises at leastone field gate programmable array configured to perform the datapreparation processing of the data.

In some embodiments, the gateway comprises a processor configured toexecute computer-readable instructions stored in a memory of the gatewayto provide a runtime support configured to program the at least onefield programmable gate array to add data preparation operations to beperformed by the at least one field programmable gate array.

According to a second aspect, there is provided a method of interfacinga gateway with a subsystem for acting as a work accelerator for a hostsystem, the gateway comprising: an accelerator interface for connectionto the subsystem to enable transfer of batches of data between thesubsystem and the gateway; a data connection interface for connection toexternal storage for exchanging data between the gateway and storage; agateway interface for connection to at least one second gateway; amemory interface connected to a local memory associated with thegateway, the method comprising: controlling the streaming of batches ofdata into and out of the gateway in response to pre-compiled dataexchange synchronisation points attained by the subsystem, wherein thestreaming of batches of data is selectively via at least one of theaccelerator interface, data connection interface, gateway interface andmemory interface; and performing data preparation processing of thebatches of data streamed into the gateway prior to said batches of databeing streamed out of the gateway, wherein the data preparationprocessing comprises at least one of: data augmentation; decompression;and decryption.

In some embodiments, the data preparation processing is performed by atleast one processor of a streaming engine of the gateway.

In some embodiments, the at least one processor is configured to executecomputer-readable instructions stored in a memory of the gateway toperform at least some of the data preparation processing.

In some embodiments, the data preparation processing comprises at leastone of: data augmentation; decompression; and decoding.

In some embodiments, the external storage is at least one of: a host;and a remote storage.

In some embodiments, the performing data preparation processing of thebatches of data comprises performing data preparation processing of datareceived from the external storage prior to said data being provided bythe gateway to the subsystem.

In some embodiments, the performing data preparation processing of thebatches of data comprises performing preparation processing of datastreamed into the gateway prior to said data being provided by thegateway to the at least one second gateway.

In some embodiments, the performing data preparation processing of thebatches of data comprises performing preparation processing of datareceived from the at least one second gateway prior to said data beingstreamed out of the gateway.

In some embodiments, the method comprises: processing a set of datareceived at the gateway to produce a plurality of sets of data; applyingdata preparation operations to each of the plurality of sets of datawith different settings applied for different ones of the plurality ofsets of data to produce a plurality of prepared sets of data; andcausing each of the plurality of prepared sets of data to be transferredto a different one of a plurality of subsystems for acting as workaccelerators to the host.

In some embodiments, the processing the set of data received at thegateway to produce the plurality of sets of data comprises at least oneof: replicating the received set of data, wherein each of at least someof the plurality of sets of data is a copy of the received set of data;and sharding the received set of data, wherein each of at least some ofthe plurality of sets of data is a subset of the received set of data.

In some embodiments, wherein the accelerator interface is configured toconnect the gateway to at least some of the plurality of subsystems toenable transfer of batches of data between the gateway and the at leastsome of the plurality of subsystems, wherein the causing each of theplurality of prepared sets of data to be transferred to different onesof the plurality of subsystems comprises providing at least one of theprepared sets of data to the accelerator interface to be transferred tothe at least some of the plurality of subsystems.

In some embodiments, the causing of each of the plurality of preparedsets of data to be transferred to different ones of the plurality ofsubsystems comprises providing at least one of the prepared sets of datato the gateway interface to be transferred to the at least one secondgateway, the at least one second gateway being configured to interfacewith at least one of the plurality of subsystems.

In some embodiments, applying the data preparation operations withdifferent settings applied comprises applying different types of dataaugmentation.

In some embodiments, applying the data preparation operations withdifferent setting applied comprises applying the same type of dataaugmentation with different parameters for the augmentation.

In some embodiments, the streaming engine comprises at least onehardware module configured to perform at least some of the datapreparation processing of the data.

In some embodiments, the at least one hardware module comprises aplurality of hardware modules each of which is configured to perform adifferent type of data preparation processing.

In some embodiments, the at least one hardware module comprises at leastone field gate programmable array configured to perform the datapreparation processing of the data.

In some embodiments, the gateway comprises a processor configured toexecute computer-readable instructions stored in a memory of the gatewayto provide a runtime support configured to program the at least onefield programmable gate array to add data preparation operations to beperformed by the at least one field programmable gate array.

According to a third aspect, there is provided a computer programcomprising a set of computer readable instructions stored on anon-transitory or transitory media which when executed by a processor ofa gateway causes the gateway to carry out the method of the secondaspect.

BRIEF DESCRIPTION OF DRAWINGS

For a better understanding of the present invention and to show how thesame may be carried into effect, reference will now be made by way ofexample to the accompanying Figures in which:

FIG. 1 is a schematic block diagram of a processor chip comprisingmultiple tiles;

FIG. 2 is a schematic illustration of a bulk synchronous parallel (BSP)computing model;

FIG. 3 is another schematic illustration of a BSP model;

FIG. 4 is a schematic illustration of the exchange of synchronisationrequests/acknowledgments between an accelerator and a gateway;

FIG. 5 is another schematic illustration of a system of multipleprocessor chips;

FIG. 6 schematically illustrates a program flow involvingsynchronisation with host;

FIG. 7 schematically illustrates a system including an accelerator,gateway, and host;

FIG. 8 is a schematic illustration of the different data paths through agateway;

FIG. 9 schematically illustrates the aggregation of accelerators, andhosts using the gateways;

FIG. 10 is a schematic illustration of the data flow through a gateway;

FIG. 11 is a schematic illustration of a system including anaccelerator, gateway, and host;

FIG. 12 is a schematic illustration of a machine including a pluralityof accelerators and gateways;

FIG. 13 is a schematic illustration of a pod including a plurality ofmachines;

FIG. 14 illustrates an example method of deploying and computing data;

FIG. 15 is a schematic illustration of the exchange of sync requests andacknowledgments between three gateways;

FIG. 16 is a schematic illustration of pre-loading data into a gatewaytransfer memory to be pulled by the accelerator;

FIG. 17 illustrates a method of streaming data to the acceleratorthrough the gateway where the gateway operates according to a pullmodel;

FIG. 18 is a schematic illustration of an example hardware module whichis configured to perform data preparation operations on data received ata gateway; and

FIG. 19 is a schematic illustration of a system in which a data set isreplicated and prepared with different settings being applied for thedifferent replicated data sets.

DETAILED DESCRIPTION

Embodiments of the application relate to a gateway for interfacing ahost with a subsystem for acting as a work accelerator to the host. Thesubsystem may be referred to as the “accelerator” throughout thedescription. The gateway enables the transfer of batches of data to theaccelerator at precompiled data exchange synchronisation points obtainedby the subsystem. Each of these pre-complied data exchangesynchronisation points acts as barrier between a compute phase and anexchange phase of the subsystem.

The gateway is configured to receive data from an external storage andstore it temporarily in gateway memory before the data is delivered tothe accelerator at the synchronisation point. This data is transferredfrom the external storage the gateway memory by operations carried outby a memory management engine. The gateway stores a set of credits thatincremented in response to completion the operations carried out by thememory management engine. Hence, the set of credits indicates theavailability in gateway memory of any data that needs to be transferredto the accelerator. When the accelerator transmits a synchronisationrequest to the gateway at a data synchronisation point, the gateway willonly acknowledge the request and transmit any data needed at thesynchronisation point to the accelerator if the number of the credits isnon-zero. Hence, if the gateway falls behind the accelerator inretrieving the data needed from external storage, the synchronisationacknowledgments will not be received at the accelerator and theaccelerator will stall, thus preventing the accelerator from runningahead.

The following description explains various examples of the applicationin further detail. This application relates to a subsystem for acting asa work accelerator for a host system and to the combination of aplurality of such subsystems. The subsystems act as accelerators toperform predetermined processing steps on data sets (work) allocated bya host which is running a process requiring large amounts of data to besubject to mainly repetitive processing. Each subsystem may be a socalled intelligence processing unit (IPU) or any class of accelerator(XPU). The techniques described herein can be used with the IPUsdescribed in our earlier U.S. application Ser. No. 15/885,925, thecontents of which are herein incorporated by reference, but also can beapplied to any accelerator. As will be described in more detail, severalaccelerators may be combined to form an accelerator machine orappliance. Several accelerator appliances may be combined in a chassis.Multiple chassis may be organised in groups, which can be arranged in arack. The resulting combinations of accelerators can yield a system witha large amount of processing power for performing parallel operations.This is particularly useful for implementing neural network processingin artificial intelligence applications. The principles laid out herecan potentially be used to scale beyond a single rack as well.

The application relates to a novel gateway which has a number ofadvantages in improving the effectiveness of such accelerators. Thegateway(s) allow the disaggregation of the accelerators from the one ormore host systems which provide the data sets for processing by theaccelerators. This has several advantages. Firstly, it allows the numberof accelerators per host to be user configurable and to be increasedbeyond the physical capacity of a host. Secondly, it allows theaccelerator I/O to be decoupled from a host, enabling IO capacity toscale as a function of the number of accelerators. Thirdly thedisaggregation enables multiple hosts to use a set of acceleratorresources which are allocated and grouped on demand to the hosts througha well-defined API that supports lifecycle management of these resourcesand associated hosts.

Each accelerator may be a single chip processor. FIG. 1 shows a singlechip processor 2, i.e. a single die, comprising an array 6 of multipleprocessor tiles 4 and an on-chip interconnect 34 connecting between thetiles 4. The processor tiles 4 may collectively perform calculations forone or more AI models. The chip 2 may be implemented alone on its ownsingle-chip integrated circuit package, or as one of multiple diespackaged in the same IC package. The on-chip interconnect may also bereferred to herein as the “exchange fabric” 34 as it enables the tiles 4to exchange data with one another. Each tile 4 is a processing unitcapable of executing instructions (code) from a local instruction memoryand handling data in local data memory. A tile 4 may comprise arespective instance of a barrel-threaded processing unit 10 and a memory11. For instance, by way of illustration the chip 2 may comprise of theorder of hundreds of tiles 4, or even over a thousand. For completeness,note also that an “array” as referred to herein does not necessarilyimply any particular number of dimensions or physical layout of thetiles 4.

Each chip 2 also comprises one or more external links 8, enabling thechip 2 to be connected to one or more other, external processors ondifferent chips (e.g. one or more other instances of the same chip 2).These external links 8 may act as chip-to-chip links for connectingtogether with one or more other instances of the chip 2 on the same ICpackage or card, or on different cards. Multiple instances of the chip 2can be connected together into cards by chip-to-chip links (as shown inFIG. 12 described later). The chip also has a connector 9 which connectsthe chip to a gateway, which is described in detail later. Note that notall accelerators need to have a gateway connector 9, but at least somedo for the purposes described herein. In one example arrangement, thechip 2 receives work from the gateway allocated by a host, in the formof input data to be processed by the chip 2. Note that references to thehost may instead imply a reference to an off chip storage system such asnetwork attached storage (NAS). The gateway enables data from a host orNAS to be provided to one or more accelerators, which are designed as asingle chip processor 2 or as multiple single chip processors 2,possibly arranged on multiple interconnected cards. The gateway enablesrelay and disaggregation between accelerator and hosts as detailedlater.

The interconnect 34 is configured to enable the different processortiles 4 in the array 6 to communicate with one another on-chip 2. In theIPU described in our earlier patent applications, communication betweentiles 4 on the accelerator 2 occurs in a time deterministic fashion.However, other forms of inter tile exchange are possible. There may bedependencies between the portions of the program running on differenttiles 4 in the array 6. That is, processing data on one tile may dependon results from another tile, e.g. may provide results on which anothertile depends. A technique is therefore required to prevent a piece ofcode on one tile 4 running ahead of data upon which it is dependentbeing made available by another piece of code on another tile 4.

Parallel programming models for AI and Data Science usually follows a3-phase iterative execution model: Compute, Barrier, and Exchange. Theimplications are that data transfer to and from an accelerator isusually barrier dependent to provide data-consistency between theaccelerators and between each accelerator and the host. Typically useddata consistency models are Bulk Synchronous Parallel (BSP), StaleSynchronous Parallel (SSP) and Asynchronous.

In SSP, the faster worker thread of a plurality of worker threads isallowed to run ahead of the slowest worker thread by a number of clockcycles. A worker thread is able to see updates made to a sharedparameter having a range of time stamps. For example, a worker at clockt is able to see all updates from workers up to those updates that aretimestamped at t−Δ. BSP is a special case where Δ=0 and therefore theworkers may not run ahead of each other.

In the Asynchronous data consistency model, the shared parameters may beread and/or written to at any time.

Embodiments of the invention described herein use a BSP model, but itwill be apparent that the other data consistency models could beutilised as an alternative.

Reference is made to FIGS. 2 and 3, which illustrate an implementationof a BSP exchange scheme in which each tile 4 performs a compute phase33 and an exchange phase 32 in an alternating cycle, separated from oneto the other by a barrier synchronization 30 between tiles. In the caseillustrated by FIGS. 2 and 3, a barrier synchronization is placedbetween each compute phase 33 and the following exchange phase 32.During the compute phase 33, each tile 4 performs one or morecomputation tasks locally on-tile, but does not communicate any resultsof these computations with any others of the tiles 4. In the exchangephase 32, each tile 4 is allowed to exchange one or more results of thecomputations from the preceding compute phase to and/or from one or moreothers of the tiles, but does not perform any new computations until ithas received from other tiles 4 any data on which its task(s) has/havedependency. Neither does it send to any other tile, any data except thatcomputed in the preceding compute phase. It is not excluded that otheroperations such as internal control-related operations may be performedin the exchange phase. Note also that a tile 4 performing computationmay be allowed during the compute phase 33 to communicate with thegateway which is external to the array of tiles 4 being synchronized—aslong as this does not involve communication with other tiles 4 withinthe group being synchronized. The communication external to the tilegroup may optionally utilise the BSP mechanism, but alternatively maynot utilize BSP and may instead use some other synchronization mechanismof its own.

According to the BSP principle, a barrier synchronization 30 is placedat the juncture transitioning from the compute phase 33 into theexchange phase 32, or the juncture transitioning from the exchange phase32 into the compute phase 33, or both. That is to say, either: (a) alltiles 4 are required to complete their respective compute phases 33before any in the group is allowed to proceed to the next exchange phase32, or (b) all tiles 4 in the group are required to complete theirrespective exchange phases 32 before any tile in the group is allowed toproceed to the next compute phase 33, or (c) both of these conditionsare enforced. In all three variants, it is the individual processorswhich alternate between phases, and the whole assembly whichsynchronizes. The sequence of exchange and compute phases may thenrepeat over multiple repetitions. In BSP terminology, each repetition ofexchange phase and compute phase is sometimes referred to as a“superstep” (though note that in the literature the terminology is notalways used consistently: sometimes each individual exchange phase andcompute phase individually is called a superstep, whereas elsewhere, asin the terminology adopted herein, the exchange and compute phasestogether are referred to as a superstep).

Note also, it is not excluded that multiple different independent groupsof tiles 4 on the same chip 2 or different chips could each form aseparate respective BSP group operating asynchronously with respect toone another, with the BSP cycle of compute, synchronize and exchangebeing imposed only within each given group, but each group doing soindependently of the other groups. I.e. a multi-tile array 6 mightinclude multiple internally synchronous groups each operatingindependently and asynchronously to the other such groups (discussed inmore detail later). In some embodiments there is a hierarchical groupingof sync and exchange, as will be discussed in more detail later

FIG. 2 illustrates the BSP principle as implemented amongst a group 4 i,4 ii, 4 iii of some or all of the tiles in the array 6, in the casewhich imposes: (a) a barrier synchronization from compute phase 33 toexchange phase 32 (see above). Note that in this arrangement, some tiles4 are allowed to begin computing 33 whilst some others are stillexchanging.

According to embodiments disclosed herein, this type of BSP may befacilitated by incorporating additional, special, dedicatedfunctionality into a machine code instruction for performing barriersynchronization, i.e. the sync instruction. The sync instruction may beexecuted on the processor of the tile, so as to start an exchange phasein which data is exchanged to cause synchronisation of data stored inmemories of the tiles.

A sync instruction has an operand which defines the sync mode. One suchmode is an intra-chip, inter-tile sync mode, which causes all tiles on achip to reach a synchronisation barrier for data exchange. This ismanaged by a compiler when the instructions for each tile are compiled,as each tile is executed according to a pre-deterministic time basedprotocol determined at compile time.

As mentioned it is possible to combine several accelerators, e.g. IPUs,to produce an accelerator machine 161 having improved processing powercompared to a single accelerator. Such an accelerator machine 161 isillustrated in FIG. 12. The accelerator machine 161 comprises aplurality (in this example four) of accelerators 162 connected in anarray with each accelerator connected to its neighbour by links 8. Themachine 161 also comprises two gateways 163 that are configured toconnect the machine 161 to one or more hosts (not shown). Each gateway163 is connected to two of the four accelerators 162 via gateway links9.

As will be explained in further detail, the gateways 163 are able toexchange data with their connected accelerators 162 in the exchangephase, following a data exchange synchronisation point. The dataexchange synchronisation point is triggered as a result of the executionof the sync instructions that are part of the pre-compiled code runningon the accelerators. At the start of the data exchange synchronisationpoint, a sync instruction may be executed on the processor of a tile.The execution of one or more sync instructions by one or more tiles ofan accelerator 162 causes one or more sync requests to be issued by theone or more tiles. These sync requests are aggregated by the accelerator162, which then issues an aggregated sync request to its associatedgateway 163. The gateways may be connected to transmit synchronisationsignals between them to enable synchronisation zones to be formed ofmultiple gateways and accelerators. One function of the synchronisationsignals is to facilitate data exchange between the gateways 163 and theassociated accelerators 162 in the exchange phase of a BSP model, butthey have other non-data related applications. Each gateway 163 has alocal memory and is configured to obtain (from the host, from remotestorage, or from another gateway) and store data to be sent to theaccelerators at a data exchange synchronisation point. The data isstored in the local memory in advance of a sync request from theaccelerator 162 so that it is ready to be transferred to theaccelerator. One function of the gateway is to supply requested data tothe accelerator when the accelerator needs it. Data can be obtained bythe gateway from the host or remote storage by different mechanisms asdiscussed later.

Each gateway 163 is also configured to exchange data with othergateways. A gateway 163 may distribute copies of data to be sent to theaccelerators 162 to other gateways. These other gateways may thendistribute data to the accelerators 162 to which they are connected.Therefore, the other gateways receiving the copies of the data need notindependently obtain the data from storage (e.g. host or remotestorage), thereby preventing redundant data from being retrieved from astorage by multiple gateways. This is described in more detail later.Furthermore, as will be described in more detail later, a gateway 163 isconfigured to enable a plurality of different types of data transfer. Agateway 163 is configured to exchange data with other gateways. Agateway 163 is configured to exchange data with one or more accelerators162 to which it is coupled. A gateway 163 is configured to exchange datawith one or more hosts (not shown).

Reference is made to FIG. 4, which illustrates an example of how thesync request/acknowledgment mechanism works in the case that one or moretiles 53 of the accelerator 51 issue requests for synchronisation to thegateway 52.

The gateway 52 comprises a register 59 that comprises an indication of async zone for an upcoming synchronisation to be carried out. Theregister 59 may be implemented in a shared register block (SRB) in thegateway 52. Prior to a barrier synchronisation, a tile 53 of theaccelerator 51 is configured to transmit an indication 32 of the synczone to which it belongs for the upcoming synchronisation. Since many ofthe tiles 53 of the accelerator 51 may belong to the same sync zone, thecompiler nominates a tile belonging to the particular sync zone forwriting the indication 32. The sync zone indicates which tiles are to beinvolved in a synchronisation together. In some cases, a sync zone mayonly comprise tiles 53 on the same chip, in which case it is understoodthat a gateway is not involved. In other cases, a sync zone may be anexternal sync including tiles 53 on different chips. In some cases, async zone includes tiles on a different accelerator. In some cases, async zone includes the gateway/s, host and/or remote storage.

Although the indication of the sync zone is here presented as beingtransmitted from the accelerator 51 to the gateway 52, in some otherembodiments, the indication may be determined by the gateway 52 andstored in the register 59. The gateway 52 may make this determinationautonomously on the basis of its pre-compiled code. In some otherembodiments, the indication may be provided as part of the sync request56 that is received from the accelerator 51, or part of the out of band(e.g. PCIe write) sync information provided before the sync request isasserted.

The data exchange synchronisation point is triggered as a result of thesync instructions pre-compiled in the code running on the tiles 53 ofthe accelerator 51. At the start of the data exchange synchronisationpoint, one or more sync instructions may be executed on the processorsof one or more of the tiles 53. Each tile which executes a syncinstruction transmits a sync request, which is received at sync logic 54of the accelerator 51. The sync logic 54 aggregates these sync requests55 and transmits the aggregated sync request 56 to the gateway 52.

The gateway 52 receives from the accelerator 51, the sync request 56,and may allow the synchronisation barrier to be passed. This involvestransmitting a sync acknowledgment 57 to the accelerator 51 in responseto the sync request 56. Allowing the synchronisation barrier to bepassed causes the tiles 53 of the accelerator 51 to exchange data witheach other and, in some circumstances, with the gateway 52 itself. Thedata exchange with the gateway 52 may involve data received at thegateway 52 from the host (not shown) being transferred to one or moretiles 53 of the accelerator 51. The data exchange with the gateway 52may involve data received at the gateway 52 from another gateway (notshown) being transferred to one or more tiles of the accelerator 53. Thedata received from the other gateway may have originated from anotheraccelerator. This is one mechanism by which data exchange betweenaccelerators may be achieved via the gateways. The data received fromthe other gateway may have originated from another host. Anothermechanism is through a facility of the gateways to enable oneaccelerator connected to a gateway to write directly to anotheraccelerator connected to another gateway, via a fabric port between thegateways. To achieve this, all storage locations in each grouping ofaccelerators/gateways (i.e. chassis/group/rack etc) form part of asingle global address space.

The gateway 52 has three data exchange boundaries: (i)gateway-accelerator; (ii) gateway-external; and (iii) gateway-gateway.These have different requirements and therefore are managed by differentprotocols. However, they have to be co-ordinated such that accelerator51 data is available in gateway memory when it is requested (i.e. onsync) by an accelerator 51, but that the gateway memory which storesdata for the gateway 52 does not overflow.

As mentioned, prior to the synchronisation, an indication is stored inthe register 59 as to the sync zone for a group of tiles 53 of theaccelerator. In some embodiments, the write 50 to this register 59 ispreferably made prior to the issuance of the sync request 56 to thegateway 52. Preferably, the tile would transmit the indication at theend of the previous exchange phase or at the beginning of the computestep preceding the exchange phase in which the correspondingsynchronisation will take place. A separate write 50 to the register 59is carried out for each synchronisation barrier. Upon receiving a syncrequest 56, the gateway 52 is configured to consume from the register59, the indication corresponding to the sync request. The gateway 52 isconfigured to only transmit the acknowledgment 57 for the sync requestto the accelerator 51 if an indication corresponding to the sync request56 has been written to the register 59. In other words, the gateway 52will only transmit the acknowledgment 57 for the sync request to theaccelerator 51 if the value has been refreshed since the last barrier.

If there is a delay in the writing to the register 59 of the indicationof the sync zone—because, for example, one or more tiles 53 of theaccelerator are unable to determine their sync zone until the end of thecompute phase—then the sync request may be received before the registeris updated with the corresponding indication of the sync zone. In thiscase, the gateway 52 waits to transmit the acknowledgment 57 until theregister 59 receives the corresponding indication of the sync zone. Thesystem may, therefore, be subject to a small latency whilst waiting forthe register 59 to be refreshed.

The gateway 52 uses the indication of the sync zone that is stored inthe register 59 to generate and transmit the sync acknowledgment 57 tothe correct tiles, chips and/or accelerators. For example, if theindication of the sync zone is that the sync zone includes theaccelerator 51 and, additionally, a further accelerator (not shown), thegateway 52 transmits a sync acknowledgment to the accelerator 51 and tothe further accelerator in response to receipt of the sync request. Thegateway 52 may read the indication of the sync zone from the register 59and in dependence on this indication, propagate the sync acknowledgmentor request 57 accordingly.

The indication of the sync zone that is stored in the register 59comprises an indication of whether or not data transfer from the gateway52 itself is required as part of the synchronisation. This indicationmay be implicit from the indication of the sync zone stored in theregister 59. If the gateway 52 determines that data transfer isrequired, the gateway 52 then applies a credit control mechanism todetermine whether or not to allow the synchronisation barrier to bepassed. If the gateway 52 determines that data transfer is not required,the gateway 52 transmits the sync acknowledgment 57 to the accelerator51 without applying the credit control mechanism. For the credit controlmechanism, if there are one or more of a first set of credits (referredto as ESP (exchange synchronisation point) credits) available in astorage (the Local Sync Barrier Module (LSBM), to be described later) ofthe gateway 52, then the gateway 52 is configured to allow thesynchronisation barrier to be passed in response to receipt of the syncrequest 56 by transmitting the sync acknowledgment 57 to the accelerator51 and transferring the data of the synchronisation to the accelerator51 from gateway memory (not shown in FIG. 4). If there are zero of theESP credits available, the gateway 52 will not acknowledge 57 thesynchronisation request 56 and the data will not be transferred from thegateway memory (not shown in FIG. 4) to the accelerator 51 thus causingthe synchronisation to stall. This credit control mechanism, which isdescribed in more detail below, allows the gateway 52 and theaccelerator 51 to remain synchronised in the BSP protocol with respectto one another.

In some embodiments, the gateway 52 and accelerator 51 each comprisepre-compiled code, allowing the gateway 52 to provide the required datato the accelerator 51 at the correct time.

After the sync logic 54 of the accelerator 51 has transmitted the syncrequest 56, the sync logic 54 will await the sync acknowledgment(sync_ack) 57 from the gateway 52. When the sync logic 54 of theaccelerator 51 receives the sync acknowledgement 57 from the gateway 52,it will return the sync acknowledgment signal 57 (sync_ack) to the tiles53 that issued the sync requests 55. All the sync requesting tiles 53will be automatically paused until the sync acknowledgment 58 (sync_ack)from the external sync logic 54 is returned. In response to the syncacknowledgement 58, the tiles 53 resume instruction issue for thesupervisor, i.e. they re-enter the compute phase.

The actual data (content) may be transmitted between the acceleratortiles 53 and the gateway 52 by a different channel to the sync requests55/56 and the sync acknowledgements 57/58. Further, it will beappreciated that the skilled person will be capable of buildingdifferent types of circuits for implementing the disclosedsynchronization and aggregation functionality given the specification ofthat functionality disclosed herein. For instance, the synchronisationlogic 54 could use dedicated wiring for transmitting the sync requests56 and sync acknowledgments 57/58. The synchronisation logic 54 couldinstead use packets carried over an interconnect as an alternative todedicated wiring. For example, the sync request 55/56 and/or the syncacknowledgment 57/58 could each be transmitted in the form of one ormore packets. For example, the sync request 55/56 and/or the syncacknowledgement 57/58 could each be transmitted in the form of one ormore packets

Reference is made to FIG. 5, which illustrates, in more detail, theconcept of sync zones. As illustrated in FIG. 5, in embodiments theindication of the sync zone that is written to the register 59 of thegateway 52 can be used to specify one of multiple different possibleexternal sync zones, e.g. zone_1 or zone_2. In embodiments, thesecorrespond to different hierarchical levels. That is to say, each higherhierarchical level 92 (e.g. zone_2) encompasses two or more zones 91A,91B of at least one lower hierarchical level. Using FIG. 9 as anexample, the two leftmost gateways and accelerators might have a synczone 0 in which the one of the two gateways is the master. Likewise, thetwo rightmost gateways and accelerators might have a sync zone 0 inwhich one of the two gateways is the master. Then there may further be async zone 1 which is the entirety of the diagram (and then any arbitrarygateway might be nominated as the sync master).

Then it would be possible for several hierarchies of sync to be utilizedby the program:

-   -   1. Internal accelerators only sync—tiles on the same accelerator        might sync    -   2. IPU+gateway only (data) sync—single accelerator asking its        gateway for sync (e.g. to coordinate the exchange of data).    -   3. Leftmost sync zone 0 (with or without credits at each        gateway)    -   4. Rightmost sync zone 0 (with or without credits at each        gateway)    -   5. Sync zone 1 (with or without credits at each gateway)

The indication may indicate gateway involvement (i.e. that data is to betransferred between gateway 52 and the accelerator 51) for thesynchronisation. The indication may indicate involvement of a furthergateway other than gateway 52, where the accelerator 51 may communicatewith the further gateway via the gateway 52. Therefore, when acorresponding sync instruction is executed, the tile 53 which executesthis sync instruction will be synchronised with the host 63 via datatransfer with the gateway 52. In the case where a further gateway isindicated for involvement, the sync request from the accelerator 51 maybe passed (after being aggregated with other sync requests received atthe gateway 52) upstream to the further gateway. The gateway 52 awaits async acknowledgment from the further gateway, before providing the syncacknowledgment to the accelerator. This scenario is described in moredetail later with respect to FIG. 8.

In response to the indication in the register 59 indicating an externalsync zone, the gateway 52 transmits a sync acknowledgment 57 to theaccelerator in the external sync zone. The dedicated hardware sync logic54 in the accelerator receives the sync acknowledgment (sync_ack) 57from the gateway and transmits the sync acknowledgement 58 to the tiles4 of the indicated group. The sync logic 54 will return the syncacknowledgment signal 58 (sync_ack) to the tiles in the signalled synczone only once a synchronization request (sync_req) 55 has been receivedfrom all the tiles 4 in that zone (but will not wait for any other tilesoutside that zone if it is not a global sync).

Note that in other embodiments, the sync zones that can be specified bythe indication in the register 59 are not limited to being hierarchicalin nature. In general, the indication in the register 59 may be providedwith modes corresponding to any kind of grouping. For instance, themodes may enable selection from amongst only non-hierarchical groups, ora mixture of hierarchical groupings and one or more non-hierarchicalgroups (where at least one group is not entirely nested within another).This advantageously enables the flexibility for the programmer orcompiler, with minimal code density, to select between different layoutsof internally-synchronous groups which can run asynchronously to oneanother until a broader synchronization is required

As explained, some synchronisation barriers involve synchronising tilesof an accelerator with data from the host, whereas some synchronisationbarriers do not. An example is illustrated schematically in FIG. 6 forthe global sync zone 92. The system is allowed to perform N supersteps,passing through N sync barriers 80, before a barrier 90 also requiringsynchronisation with the host 63 is imposed. At the synchronisationbarrier 90 with the host 63, data, which has been transferred to thegateway 52 from the host 63, is transferred to the accelerator 51 fromthe gateway 52. The N sync barriers require sync requests from all the(non-abstaining) tiles 4 in the relevant sync group 92 but not the host63. The subsequent sync barrier 80 requires sync requests from all the(non-abstaining) tiles 4 in the sync group 92. Furthermore, to pass thesync barrier 80 requires that the gateway stores at least one ESP creditto pass the particular barrier. After this barrier 90, an exchange 50″may be performed between the gateway and one or more of the tiles 4,e.g. for one or more of the tiles 4 to report computation results to thehost 63.

Reference is now made to FIG. 7, which illustrates in further detail howa host 63 interacts and exchanges data with an accelerator 51. The host63 is configured to provide data for the accelerator 51 to process. Theaccelerator 51 is configured to process the data and deliver the resultsof the processing to the host 63. The gateway 52 is responsible forstreaming data in a managed fashion between the host 63 and theaccelerator 51 for the exchange of data. In the example, the accelerator51 may be an IPU as described above with reference to the precedingFigures. However, the gateway 52 may be useable for interfacing a host63 with other types of accelerator 51.

Data synchronisation between host 63, gateway 52 and accelerator 51through Exchange Synchronisation Points ensures gateway data consistencyand readiness for I/O operations. The availability of data betweengateway 52 and accelerator 51 is handled via a credit mechanism of ESPcredits. One credit allows one ESP to be passed. The gateway memory 114preparation, ahead of an ESP, is handled by the gateway 52 executing“pre-work” instructions. The data handling after the ESP is performed byexecuting “post-work” instructions. A PPE execution engine 123,described later, executes the pre- and post-work instructions.

As shown in FIG. 7 (and referring also to FIG. 5), the gateway 52comprises at least one “Local Sync Propagation Module” (LSPM) 117 and atleast one “Local Sync Barrier Module” (LSBM) 118. The LSBM 118 can beconsidered as a kind of proxy to the PPE and enables the program runningon the accelerators to process batches of data to be decoupled from thehost. The accelerator 51/gateway 52 synchronisation can runasynchronously from the host 63 activity in providing data to thegateway 52. The LSBM 118 is configured to store the ESP creditsdiscussed above. The LSBM is accessible to the LSPM 117

The LSBM 118 comprises hardware circuitry configured to enable the host63 to participate in the respective sync group 92 in which the LSBM 118is arranged to act as a proxy to the PPE. A sync request 56 emitted bythe tiles 4, if it is a sync with gateway involvement, will be usingboth the LSPM 117 and LSBM 118 of the gateway 52 whereas a sync request56 for a sync which does not involve transfer of data between gateway 52and accelerator 51 will be received by the LSPM 117 and returned to therequesting tiles without involving the LSBM 118. Thus the tiles 4determine by virtue of the program they execute when, if at all, theaccelerator 51 requires to interact with the gateway via the LSBM 118.

If the accelerator 51 requires to interact with the gateway, the LSBM118 is then configured to allow the synchronisation barrier to be passedwhen a sync request 56 is received, providing the number of ESP creditsis greater than zero. Allowing the synchronisation barrier to be passedinvolves generating a sync acknowledgement (not shown) and sending thissync acknowledgment to the accelerator 51.

As explained above, the gateway 52 stores a set of credits associatedwith the interface between itself and the accelerator 51. These creditsare referred to in the description as exchange synchronization points(ESP) credits. However, the skilled person would understand that thisname is used to conveniently identify the credits only and does notimply a limitation as to the nature of the credits. The ESP credits mayalso be referred to as barrier credits, since they control whether ornot a data exchange operation may be executed for one barrier.

If the number of ESP credits in the LSBM 118 is zero, when a syncrequest 56 is received and the corresponding indication in the register59 is such that data transfer with the gateway is required, the LSPM 117does not allow the synchronisation barrier to be passed and thereforedoes not allow the tiles 4 in the group 92 to continue running againuntil the number of ESP credits is greater than zero. The generation ofESP credits may be achieved when data, which is for transfer to theaccelerator 51 at the exchange synchronisation point, becomes availablein the gateway 52. In some cases, this data may become available as aresult of it being transferred from the host 63 or network attached orother external storage. In other cases, this data may become availableas a result it being transferred from another gateway. The data receivedfrom the other gateway may be data from another accelerator or fromanother host or remote storage.

In some embodiments, there may be a plurality of sets of ESP creditsheld by the gateway 52. There may be different sets of credits fordifferent sync groups. In this case, a sync request 56 corresponding toone sync group may cause the gateway 52 to acknowledge the request (ifthe number of ESP credits for that group is non-zero), whereas a syncrequest 56 corresponding to another sync group may not cause the gateway52 to acknowledge the request (if the number of ESP credits for thatgroup is zero). There may also be different sets of credits for thedifferent accelerators configured to communicate with the gateway 52. Asshown in FIG. 12, each gateway 163 is configured to communicate with twoaccelerators 162, and therefore, the gateway 52 may store two sets ofESP credits for each accelerator 162. If each accelerator 162 has twopossible sync groups requiring gateway data transfer, this leads to foursets of credits in total being held by each gateway 163.

In some embodiments, the different credit sets that are established fordifferent sync zones for an accelerator may be controlled by a singleESP credit register in the LSBM 118. In this case, all of the per synczone ESP credit sets will be identical to a single ESP credit registerthat controls all credits in the GW for a given accelerator. When a syncbarrier is passed, the ESP credits of the single ESP credit register forthe accelerator will be decremented.

Tiles 4 of a sync group can be allowed to continue running through Nbarriers synchronized (with sync requests being forwarded to andacknowledged by the LSPM 117) without requiring the checking of ESPcredits of the gateway to be carried out, after which they must thensynchronize with the gateway via the LSBM 118 (and may then exchangedata to and/or from the gateway. See for example FIG. 6.

As explained above, the software running on the tiles 4 is programmed torequest a sync with the gateway by transmitting an indication (which maybe included in the sync request or transmitted separately) as to whetheror not gateway involvement is required for the sync. This indication isstored in register 59 of the gateway 52. In such embodiments, the abovedescribed credit control mechanism is applied only by the LSBM 118 forthe barriers corresponding to syncs marked as requiring gatewayinvolvement (the “involvement” of the gateway for any given barrierbeing either the proxy granting (LSBM) of the sync ack by the LSPM 118on behalf of the host, or occasionally the explicit granting of more ESPcredits to LSBM 118). In embodiments, the gateway involvement isselected by different variants of the sync zone indication that isstored in the register 59. That is, for each sync group 91, 92, there iseffectively two variants that the sync zone indication can take:zone_1_host, zone_1_no_host; and zone_2_host, zone_2_no_host. Theexecution unit of the tile is configured to cause the synchronizationlogic 54 to signal the gateway involvement marker accordingly. In otherembodiments however, it is not excluded that other mechanisms could beimplemented for requesting gateway involvement, or even (though lesspreferred) that gateway involvement is hardwired and therefore alwaysimposed.

In embodiments, preparation for barriers performed by the gateway mayinclude the preparation of data to be fetched by the accelerator 51,such as experience data sets required by the accelerator 51 for the nextstage in learning a model. Preparation in this context may includefetching the data from storage disks or other media, formatting data ina form which is required by the training algorithm running on theaccelerator 51 or decompression of image data. Additionally, preparationfor barriers may include consuming output data produced by theaccelerator 51. As discussed later, some or all of this preparation maybe conducted at the gateway 52. As a minimum, the gateway 52 is in thepathway between the storage disks or other media and the accelerator 51.

The sync request 56 to the LSBM 118 could be delivered from a processingelement as a network (or PCIe) packet, and/or the sync acknowledgment 57could be returned as a network (or PCIe) packet. In general the (or a)gateway may be involved in any one or more of the hierarchical levels ofsync.

Generally, the concept of ESP credits can be applicable to anymulti-tile architecture, not just the example architecture disclosedherein. Nor is it necessarily limited to the BSP application context.The disclosed technique has a particular synergy with systems whichemploy a single rendez-vous point such as BSP, or when the number ofdistinct rendezvous points between a host or other outside-world systemand the machine in question is limited to just one rendezvous or a verysmall number (as opposed to, say, CSP). Nonetheless the applicability ofthe present disclosure is not absolutely limited in this respect. In anysystem or application, a latency saving can be achieved by enabling thetiles to pass through a specified number of synchronization barrierswithout involving the gateway, thus reducing the number of times themulti-tile sub-system has to interact with the gateway and thereforereducing the number of times the latency penalty of doing so isincurred.

Furthermore, although embodiments have been exemplified in terms of aPCIe interface between cards or with the host 63, this is not limitingand other types of interface could be used, e.g. Ethernet.

Furthermore, the implementation is not limited to synchronisingcommunications between a host system 63 and an accelerator 51 whichwould otherwise run asynchronously. In embodiments, the gateway 52 couldbe employed for the synchronization between two independent BSP or otherparallel processing subsystems, which run synchronously internally, butrun asynchronously, with respect to one another. The gateway 52 allowsthe size of a sync group to be increased to a much larger size andenables a more efficient tree structure for those larger groups.

The batches of data received at the gateway 52 are stored in a memory114. The memory 114 is a local memory (e.g. DRAM) that is reserved foruse by the gateway 52. In response to the sync request 56, the data maybe retrieved from the memory 114 by the gateway 52 and transferred tothe accelerator 51. The path 116 illustrates the flow of each batch ofdata. Note that each batch of data is held in the memory 114 for aperiod of time which may vary from batch to batch. It depends on thetime the batch enters the gateway 52 and the time it is pushed to theaccelerator 51, and these are not necessarily related.

The LSPM 117 may be configured to indicate, to the gateway 52, thetiming of the transfer of data from the memory 114 to the accelerator51, or from the accelerator 51 to the memory 114. This allows the LSPM117 to dictate the appropriate timing for the deployment of data fromthe accelerator 61 to the memory 114 so as to prevent overflowing of thegateway memory 114.

Furthermore, the flow of data into the gateway memory 114 from thehost/remote storage is managed so as to avoid overflowing the gatewaymemory 114.

In FIG. 7, data for processing by the accelerator 51 is transferred fromthe host 63 to the gateway 52, which stores it in local memory 114. Thedata may be pulled by the gateway 52 via RDMA read or may be written viaan RDMA write made by the host 63 to the gateway 52.

Reference is made to FIG. 11, which shows an alternative scheme in whichdata 116 is retrieved by the gateway 52 from a network attached storage151. The network attached storage 151 is also be referred to herein asremote storage. In FIG. 11, like elements to elements of FIG. 11 areindicated with like reference numerals.

In FIG. 11, the host 63 sends a descriptor 119 to the gateway 52. Thedescriptor 118 identifies the location of a network attached storage 151that is accessible to the gateway 52. The gateway 52, when executing adata fetching instruction referring to the descriptor 119, retrieves thedata 116 from the network attached storage 151. The gateway 52 thenstores the data 116 in memory 114 prior to transferring the data to theaccelerator 51.

In some embodiments, instead of transferring the descriptor 119 from thehost 63 to the gateway 52, the pre-compiled code stored by the gateway52 includes the descriptor. In this case, the gateway 52 autonomouslyretrieves data from the remote storage 151 without the intervention ofthe host. In some examples of the application, the gateway 52 comprisesa System on Chip (SoC) serving as a standalone appliance so that noexternal host 63 is required. The entire application stack runs directlyon the SoC or on one of the SoCs in the broader system. The gateway 52is configurable to operate in a first mode where it interacts with anexternal host 63 processor and a second mode where no such external host63 is required. The remaining parts of the gateway 52 (e.g. thestreaming engine, described with respect to FIG. 8) perform the samefunctions irrespective of which of these modes the gateway 52 isconfigured to operate in.

Reference is made to FIG. 8, which illustrates the gateway 52 in moredetail. FIG. 8 shows the various paths that data takes through thegateway 52.

FIG. 8 shows how data 120, which is for processing by the accelerator51, is transferred to the memory 114 from the host 63 or remote storage151. As already mentioned, in some examples, the data 120 is transferredto the gateway 52 from the host 63. In other examples, the data 120 isreceived from local or remote storage 151 (e.g. network attachedstorage) in response to a read request from the remote storage 151 madeby the gateway 52. The gateway 52 retrieves the data 120 from the remotestorage 151 via RDMA. The data 120 is received via the data centreports. Additionally, as well as retrieving data, the gateway 52 writesdata (not shown) to the host 63/remote storage 151. The data writes aremade via the data centre ports. During the exchange phase, data may betransferred from gateway memory 114 to the accelerator 51.

Instead of, or in addition to, the transfer of data to the accelerator51 from gateway memory 114 during the exchange phase, data may betransferred from the accelerator 51 to the gateway 52. The accelerator51 is configured to send the data in the form of data packets to thegateway 52, wherein each data packet includes a header indicating anaddress. The gateway 52 uses the address of the data packets todetermine where to send them. For example, the data packets may bestored in local memory 114. The data packets may be sent to a furthergateway 128. The data packets may be dispatched to an acceleratorconnected to the further gateway 128. The data packets may be sent tohost 63/remote storage 151.

The data 120 traverses the gateway 52 to the memory 114 under thecontrol of a streaming engine 124 (which is also responsible forretrieval of data 121 from memory 114 for delivery to the accelerator51). The streaming engine 124 performs execution of the data streamingoperations. These operations for a batch of data may be specified by awork descriptor (WD). The streaming engine 124 comprises two executionengines and code memory (not shown). One of the execution engines is aData Mover Engine (DME) 122, the other is a Pre/Post Work engine (PPE)123. They execute instructions loaded into the code memory as anexecutable image, which is produced by a compiler. The streaming engine124 has a set of work instructions for execution by the DME 122 and aset of work instructions for execution by the PPE 123. The sets ofinstructions for the DME and PPE are coordinated by the WD, as set up atcompile time. These instructions for a single data exchangesynchronisation point may be grouped together into a single WD. The DME124 is operated by specific DME instructions found in the DME sectionsof the executable image. The DME 124 uses the WD for navigating to theset of data mover (DMOV) instructions that relates to a given ESP. ThePPE 123 is operated by specific PPE instructions found in the PPEsections of the executable image. The PPE 123 uses the WD for navigatingto the set of pre/post-work instructions that relates to a given ESP.

The PPE's pre-work must be ready before the data exchange with theaccelerator 51. The PPE's post-work in the WD can only start after theexchange has completed. The data exchange comes immediately after thesync request 56 is acknowledged and signalled both to the accelerator 51and streaming engine 124. This request/ack signals an “ExchangeSynchronization Point” (ESP).

The streaming engine 124 supports different data streaming models.

All models support a configuration where a host is allowed to tightlycontrol the consumption of ESP credits. This supports the co-ordinationof I/O operations between host 63, gateway 52, and accelerator 51, aswell as a mechanism for stalling the accelerator 51 in case this isneeded for other accelerator level I/O mechanisms not making use of thegateway memory 114. It may also be a mechanism used for settingbreak-points or single-stepping a full fabric of accelerators. Whenrunning any model under tight flow-control from a host 63, the ESPcredits granted by the host 63 are transferred by the PPE scheduler tothe “ESP credit register” (part of the LSBM 118). The ESP CreditRegister can be read/written by gateway 52 hardware and firmware.

The different streaming models will now be discussed. It would beunderstood by the skilled person that the streaming models are notmutually exclusive, but that a gateway according to embodiments of theapplication may operate according to more than one model.

The first streaming model that is supported by the streaming engine 124is referred to as “Advanced Gateway (GW) push”. In Advanced GW push, thePPE 123 streams data from/to external storage and the gateway (GW)memory 114, whilst the DME 122 pushes data to the accelerator 51.Execution is based upon instructions from the compiled executable imageheld by the gateway. Generation of the executable image for thestreaming engine 124 is integrated with the accelerator compiler. Thecompiler generates two related complied code sequences or executableimages. A first of these is executed on the accelerator 51, whilst thesecond is executed on the gateway 52. In some embodiments, the host 63may provide the compiled code sequences to the accelerator 51 andgateway 52.

The “gateway push model” is a usage model where the gateway 52 is theone that pushes data. This model differs from the “gateway pull models”(discussed below) in that it pushes data to the accelerator 51 at agreedpoints in times (at agreed ESPs). This generic push model can supportdifferent types of Memory Consistency Protocols or Bridging Models forparallel programming. Examples include Bulk Synchronous Parallel (BSP),Stale Synchronous Parallel (SSP) and Async Parallel.

The Advanced gateway (GW) push model uses the credit mechanism forcontrolling the availability of data input (relative the accelerator) tobe pushed, as well as availability of gateway 52 data buffers for theaccelerator 51 to output data into. The gateway 52 executes both DataMover Instructions (DME 122 is pushing data to the accelerator 51) ANDpre/post-work engine instructions for transferring data with theexternal nodes (host, NAS, or other gateways). The PPE 123 isresponsible for effectively stalling the DME 122 through missing ESPcredits when accelerator input data is not available due to external I/Obottlenecks. A similar stall is also required when accelerator outputdata (headed for remote host/storage) is piling up in gateway 52 memory114 due to external I/O bottlenecks.

Data may be delivered with low latency by pre-fetching the data from GWmemory 114 into a high speed gateway transfer memory 127 (e.g. SRAM)before the push to the accelerator 51 happens.

The memory consistency models as described above (BSP, SSP, Async etc.)could be combined with the push model. The accelerator 51 run-time wouldthen have to make sure that external barriers will trigger DME 122 andPPE 123 data movement. In case of a push operation, the ESP credits willbe decremented by one by the gateway 52.

In the above described streaming push model, the gateway 52 hides theaccelerator memory access latency by using the gateway memory 114 as anon-chip streaming buffer. The overall benefits of the streaming engine124 are that data movement can be overlapped with acceleratorcomputation and pre-loaded into the memory 114 of the gateway 52 aheadof timed push operations.

The second streaming model is referred to as advanced accelerator pull.In this streaming model, a PPE 123 streams data from/to external storageinto gateway memory 114. The accelerator 51 then pulls data from theGateway 52 via a PCIe read operation(s). PPE 123 execution is based uponinstructions from the executable image in code memory.

In this model, the PPE 123 is active and obtains the data and store itin memory 114 by issuing “pull requests” (i.e. read requests) from theexternal storage. The accelerator 51 will then pull data from thegateway at the pre-defined ESPs. The advanced accelerator pull modelmakes use of an executable image that contains pre/post-workinstructions, without the DMOV push instructions. However, as will bediscussed, the DME 122 may still execute instructions from theexecutable image to pre-load the data to a high speed gateway transfermemory (e.g. SRAM) from which data can be pulled at low latency by theaccelerator 51.

In the Pull model, the host 63 synchronizes the accelerator 51 via theESP credit mechanism so that it pulls valid data prepared in gatewaymemory 114 at the expected ESP. Also for this model, the PPE 123 isresponsible for stalling the LSPM (via a credit mechanism) whenaccelerator 51 input data is not available due to external IObottlenecks. A similar stall may also be performed when accelerator 51output data (headed for remote host/storage) is piling up in gatewaymemory 114 due to external IO bottlenecks.

In the Pull model, some or all of the data to be transferred to theaccelerator 51 at an upcoming ESP, is pre-loaded from the memory 114into a gateway transfer memory (e.g. SRAM) prior to be pulled from thegateway transfer memory by the accelerator 51. This gateway transfermemory may be the same or different to the gateway transfer memory 127shown in FIG. 8 and used to store data to be pushed to the accelerator51.

Reference is made to FIG. 16, which illustrates the interaction betweenthe gateway 52 and the accelerator 51 when the pull model is used. Asshown, the gateway 52 comprises a gateway transfer memory 1610. Thegateway transfer memory 1610 comprises a series of streaming buffers(shown as virtual FIFOs).

In some embodiments, to perform the pre-loading, at least one processorof the streaming engine 124 is configured to execute instructions of theexecutable image. In some embodiments, commands from the host 63 oraccelerator 51 may cause the streaming engine to perform thepre-loading. The DME 122 is described as performing these operations inthe following description of the pull model. However, it would beappreciated that in some embodiments, the operations for transferring tomemory 1610 may be performed by hardware other the DME 122. The hardwarethat performs the pre-load operations may be a field programmable gatearray (FPGA).

The DME 122 pre-loads data into the memory 1610 for a predefined numberof upcoming ESPs. The accelerator 51 is configured to issue readrequests to read the pre-loaded data directly from the memory 1610 inresponse to attaining an ESP. As shown in FIG. 16, the accelerator 51may additionally pull data from the memory 114.

The data that is pulled from the gateway 52 may be organised into aplurality of accelerator input streams. An accelerator input stream isdefined as a plurality of sets of data which are transferred to theaccelerator memory in a fixed order. Each set of data can be anyarbitrary size and a single stream can be any arbitrary number of setsof data. The sets of data are arranged into data buffers (not to beconfused with the virtual FIFOs of memory 1610). In the pull modeldiscussed here, these sets of data are delivered to the IPU by means ofIPU issued reads. There is no ordering between any two input streams.

The memory 1610 is organised into a set of buffers (shown as virtualFIFOs). The buffers are preferably virtual data buffers, that aredefined by a virtual address space that maps to a physical range ofmemory address (which may be contiguous or discontiguous) in the memory1610. The virtual buffers are read from and written to at locations inthe memory 1610 indicated using a read pointer and write pointer,respectfully. The pointers are held in a memory of the gateway (whichmay be the same as or separate to memory 1610). The virtual buffers arepreferably virtual FIFOs, as shown in FIG. 16.

Each buffer corresponds to a different input stream. From theaccelerator's perspective, a particular input stream is located at aparticular location in memory 114. However, at least some of the datafrom that input stream may have been pre-loaded to a buffer of memory1610. To pull data for that input stream from the gateway, theaccelerator issues consecutive reads to addresses in memory 114. Theread requests also include a number of bytes to be read for that inputstream. When the gateway 52 receives the read request, logic of thegateway 52 determines on the basis of the address information located inthe read request, the input stream from which the read request isreading from. If the buffer for this input stream is in the loadedstate, then the data is read from that buffer instead of from memory114. If the buffer is loading, then the data is read from that bufferonce the loading is complete. If the buffer is not loaded or loading,then the data is read from the memory 114 at the address indicated inthe request.

Since the accelerator 51 is issuing requests to read from specificmemory addresses in memory 114, and a FIFO structure is being used inmemory 1610, it may be guaranteed that the same data is returned as ifthe read were being done from memory 114. If two tiles are allowed toread from the same input stream, then that is not guaranteed, since onetile has no knowledge of where the other tile is in the reading process,and therefore may issue a request to read particular data from aparticular address, when the other tile has already read this data fromthe FIFO. This problem addressed by ensuring that the reads for aparticular input stream are all issued by the same tile of theaccelerator 51 so that the reads received at memory 1610 are in theappropriate order.

The gateway 52 is configured to store state for each input stream. Thestate stored for an input stream comprises a base address and a size.This indicates the address range of the memory 1610 which theaccelerator uses to access the input stream. This is maintained in thestreaming buffer/port logic.

The state stored for an input stream may comprise the number of bytesloaded into the buffer associated with the input stream.

The state stored for an input stream may comprise the load state of abuffer associated with the input stream. The load state is an indicationas to whether or not the buffer has been pre-loaded with data to betransferred to the accelerator 51.

There are a few possible approaches to managing the set of buffers of aninput stream. In some embodiments, the buffer address and size for eachbuffer is fixed. The accelerator is configured to issue reads repeatedlyfrom the same buffer.

In some embodiments, the buffer address and size is determined by valuesstored in a control and status register (CSR) of the DME 122. The valuesstored in the CSR are determined prior to execution of the relevantpre-load instruction by the DME 122.

In some embodiments, the buffer address and size is indicated in thepre-load instruction executed by the DME 122. These indications arepassed from the DME 122 to the gateway transfer memory 1610 as part ofthe pre-load process. The indications may, for example, be passed inheaders of the data that is pre-loaded into memory 1610. This approachprovides a high level of flexibility.

As noted, the gateway transfer memory 1610 is implemented as a set ofbuffers, where one buffer corresponds to one accelerator input stream.In the example, shown in FIG. 16, the memory 1610 is configured tosupport four such virtual FIFOs, however, another number of virtualFIFOs may be used. Four is chosen in this example, since it is thenumber of accelerator tiles needed in order to produce sufficientbandwidth of communications to saturate a single PCIE link.

Data loaded into the memory 1610 is loaded by an engine (e.g. the DME122) running on the gateway 52. The engine may be implemented inhardware (e.g. in an FPGA) or in software (e.g. as code executing on aCPU).

Prior to an ESP, the DME 122 will load data into one of the virtualFIFOs in memory 1610 with the data for the next step. The state of thebuffer is then set to indicate that the buffer is loaded with data. Whenthe gateway 52 receives a read request from the accelerator 51, the datais transferred to the accelerator 51 in response to determining that thecorresponding buffer is in the loaded state. The determination is madeby FPGA logic on the gateway. If instead of determining that the bufferis in the loaded state, it is determined that loading is progress, thedata will be transferred from the buffer when loading for the buffer iscomplete. If it is determined that the buffer is not loaded and it isnot loading, the data will be read from memory 114.

In some cases, not all of the data may be pre-loaded into the memory1610 prior to the upcoming ESP. In this case, when the ESP occurs andthe accelerator 51 initiates the read of data of an input stream fromthe memory 1610, the DME 122 pre-loads any remaining data of the inputstream that is to be transferred to the accelerator 51 during theexchange phase following the ESP. Therefore, the pre-loading of theremaining data of an input stream occurs at the same time as data of theinput stream is being pulled from the memory 1610. The data is pulledfrom the memory fast enough to make space for the remaining data that isbeing pre-loaded during the exchange phase.

The memory 1610 is emptied by reads issued by the accelerator. Readsfrom the accelerator for a particular input stream arrive at the gateway52 in address order. The reads start from the base address of the bufferand continue through the entire address range of the buffer.

When the gateway 52 receives a read it compares the address to the setof buffer address ranges in memory 114 for an input stream. If a readlies in the range specified for that input stream, then the read will beexecuted by transferring the next predefined number of bytes (asspecified in the read request) from the buffer associated with the inputstream of memory 1610 to the accelerator 51. The offset portion of theaddress may be ignored, with the data being read out of the buffer in aFIFO fashion.

Each of the buffers is associated with a read count indicating the totalamount of data read from the buffer. As accelerator reads are processedfor a particular input stream, this count increases. When the countreaches the size of the entire buffer, the state of the buffer ismodified to indicate that the buffer is empty. The DME 122 is theninformed that the reading of data from the buffer is complete.

The example gateway transfer memory 1610 shown in FIG. 16 is configuredto store data for four input streams. If more there are more than fourinput streams of data transferred to the accelerator, then theaccelerator pulls the data for those additional streams from the memory114 instead of from gateway transfer memory 1610. If an input stream isdetermined to be too large to store the data for that stream in thegateway transfer memory 1610, then the accelerator pulls data for thatstream from the memory 114 instead.

In the case in which a stream is read from memory 114 instead of memory1610 by the accelerator 51, then the DME 122 is not loaded withinstructions related to this stream and the buffer would not beallocated in the memory 1610 for this stream. The reads related to thisstream would then be directly by the gateway 52 to the memory 114.

As discussed in relation to FIG. 4, when one or more tiles 53 of theaccelerator 51 require to exchange data with the gateway, they transmitsynchronisation requests 55 which are aggregated and passed via synclogic 54 to the gateway 52. The gateway 52 in turn transmits asynchronisation acknowledgement to the sync logic 54, which returnssynchronisation acknowledgments to the tiles 53 which sent thesynchronisation requests. FIG. 16 illustrates the messaging that occursfollowing this sync request/ack scheme when a tile 53 pulls data frommemory 1610 in the gateway.

Following receipt of a synchronisation acknowledgment, as shown in FIG.16, a tile 53 transmits one or more control packets 1620. The one ormore control packets may be transmitted by the tile in response to theexecution of an READ instruction of supervisor thread of the tile 53.The control packets are transmitted to read request logic 164 of theaccelerator 51. The read request logic 164 may be a PCIe controller. Inresponse to the one or more control packets, the read request logic 164is configured to generate a read request 165 that is sent to the memory1610 of the gateway 52. The read request 165 is a DMA read request. TheDMA read request 165 may be a PCIe read. In response to the read request165, the data 163 is read by logic of the memory 1610 and sent to theread request logic. The read request logic transfers the data 163 to thetile 53 that issued the READ instruction. Additionally, these operationsmay be carried out to pull data from the memory 114.

Reference is made to FIG. 17, which illustrates an example of a method170 according to embodiments of the application. The method 170 showssteps performed when the gateway 52 operates according to the pullmodel. The steps take place after the data has been transferred fromexternal storage to gateway memory 114.

At S171, the DME 122 determines whether or not there is space in thegateway transfer memory 1610 for pre-loading a given stream of data intothe memory 1610. There is determined to be space if the maximum numberof streams (i.e. four in the example shown in FIG. 16) that the memory1610 can store data for would not be exceeded and the stream of datadoes not exceed a maximum permissible size.

If there is space available, at S172, data of the stream is pre-loadedfrom the memory 114 into the memory 1610. The data for a stream that ispre-loaded may comprise data to be transferred to the accelerator 51during a plurality of upcoming exchange phases.

If there is not sufficient space available, at S173, data of the streamremains in main gateway memory 114, without being pre-loaded.

At S174, a synchronisation request is received from the accelerator 51at the gateway 52.

At S175, a check of the ESP credits stored in the gateway LSBM 118 ismade. Assuming that there is a non-zero number of credits available forthe relevant accelerator and sync group, the method 170 proceeds toS176.

At S176, the gateway 51 transmits a sync acknowledgment to theaccelerator 51.

At S177, in response to receiving the sync acknowledgment, theaccelerator 51 issues a read request to pull the data from the gateway52. The accelerator 51 reads data from at least one of the main memory114 and the gateway transfer memory 1610. The accelerator 51 reads fromthe memory 1610, data of streams that were pre-loaded into the memory1610. The accelerator 51 reads from the memory 114, data of streams thatweren't pre-loaded into the memory 1610.

At S178, whilst the accelerator is reading data from the memory 1610,the DME 122 continues to pre-load data into the memory 1610 to be readby the accelerator 51. The accelerator 51 may read from a buffer of astream, with the DME 122 overwriting data that has been read the bufferwith additional data of the stream from the memory 114. The data that ispre-loaded during the reading by the accelerator 51 is the remainingdata that is to be transferred to the accelerator 51 during the currentexchange phase.

The pull model using the pre-loading has the advantage that the gateway52 is able to prepare data in the high speed transfer memory 1610 inadvance of an upcoming pre-compiled exchange synchronisation point, suchthat the data is available to be pulled by the accelerator 51 in a moretimely fashion. Therefore, data may be pulled from the gateway 52 at alower latency. Additionally, pre-loading data to the high speed transfermemory 1610 improves the bandwidth of data transfer.

The third streaming model is referred to as simple accelerator pull. Inthis streaming model, the host 63 streams data in to/out of gatewaymemory 114. The accelerator 51 pulls data from the gateway 52 via PCIeread operation(s). The gateway 52 in this case does not execute PPEinstructions but is instead a slave of a predefined I/O scheme betweenhost 63 or NAS and the gateway 52.

In this model, the gateway memory 114 serves as a memory region, whereinthe host 63 has control over its contents. There are no instructionsexecuted in the gateway 52 for loading data in memory 114. The PPE 123is not executing instructions, but is still functioning as a proxy toupdate ESP credits and instruct DME for pre-loading operations given bythe host 63 for the accelerator 51 to discover when data is available.

The gateway memory 114 allocated for the streaming of data is maintainedby host 63 as if it was PCIe attached memory, with the only differencethat RDMA is used instead of PCIe.

In the simple pull model, data is also pre-loaded into the gatewaytransfer memory 1610 as described above for the advanced pull model withreference to FIGS. 16 and 17. In the simple pull model, the PPE 123 willreceive commands from the host 63 and/or accelerator 51 instructing thepre-loading of data into the memory 1610. In response to the receivedcommands, the PPE 123 causes the DME 122 to pre-load data into memory1610. The PPE 123, therefore, acts as proxy for pre-load commands comingfrom the host 63 and/or accelerator 51.

Furthermore, the simple pull model is distinct from the advancedaccelerator pull model in that, in the simple pull model, the PPE 123does not execute instructions to retrieve data from the host or otherexternal storage.

Execution of the data streaming operations in the gateway 52 isperformed by the streaming engine 124 that, depending on the operationalmodel, will run either: all (in the advanced push model) of the gateway52 instruction set, a subset (in the advanced pull model) of the gateway52 instruction set, or no instructions (in the simply pull model) of thegateway 52 instruction set. In the simple pull model, the gateway 52performs the streaming operations in response to commands from the host63 or accelerator 51.When the gateway 52 executes all or some of the instruction set, theinstructions are loaded into gateway memory 114 as an executable image.Generation of executable images for the streaming engine 124 will beintegrated with a specific accelerator/gateway compiler environment inwhich the compiler produces related code for running on the accelerator51 and gateway 52.

The streaming engine 124 can be seen to comprise a set of hardware andsoftware components that work together to ensure that the acceleratorsare supplied with data I/O in a performance optimal way. Depending onthe operational model of the gateway 52 or streaming engine 124, thestreaming engine 124 may push data in a “just in time” fashion, i.e. atplanned data exchange phases representing a conditional entry-point tothe next accelerator compute step, or may make data available in gatewaymemory 114 and/or memory 1610 for the accelerator 51 to pull in the same“just in time” fashion. Preparing relevant data in gateway memory 114prior to the data exchange phase is done via pre-scheduled datastreaming instructions executed by the gateway streaming engine 124. Thepush model can additionally pre-fetch data from the gateway memory 114into gateway transfer memory 127 (e.g. SRAM) for reduced latency duringdata exchange phases. The concept of bringing data into gateway memory114 “just in time” is useful for cases where the gateway memory 114 isnot large enough for holding all the data needed by acceleratorcomputation algorithms.

The PPE engine uses the WD for navigating to the set of pre-work (PRW)and post-work (POW) instructions that relate to a given ESP. The terms“pre” and “post” indicate whether the operation happens before or aftera WD's data exchange phase with an accelerator or other target. The PRWinstruction has as its main responsibility to bring data into gatewaymemory 114 (e.g. from host 63, remote storage 151, or from a furthergateway 128) from the host 63 or as a preparation for one or more DMOVpush instructions. “Post-work” has, as its main responsibility, to movedata out of GW memory 114 (e.g. to host 63 or remote storage 151). ThePPE instructions are located in the PPE specific image section.

The DME 122 is active for transferring data from the gateway to theaccelerator in the “gateway push” operational model as described above,and also active in both pull models for pre-loading the memory 1610VFIFOs if this pre-loading optimization is enabled. In the push model,the DME 122 uses the WD for navigating to the set of data mover (DMOV)instructions that relate to a given ESP. The DMOV instructions push datatowards the accelerator. The WD and DME related instructions are locatedin a DME specific image section. The DME instructions sourced from theimage in physical DDR memory of the gateway 52 are converted into DMAdescriptor lists that are executed by the DME's DMA machine as part ofthe DMOV instructions. The DME 122 will prepare DMA descriptors forseveral planned data exchanges that are controlled by stop criteria thatallows full control of the size of each batched data exchange with theaccelerator 51.

The DME 122 uses a high level programmable multi-channel DMA machinedesigned for streaming data in and out of accelerator memory. The DME122 supports streaming of data to a single accelerator 51 over one ortwo high speed data buses using load-distribution. If the accelerator 51is agnostic to data loading sequences, the load-distribution is achievedby local DME decisions and is not controlled by information found in theexecutable image.

A WD is considered “ready for execution” (or fully prepared) when allpre-work related instructions for the WD are completed as well as allthe post-work instructions that have an end-criteria for this WD. Onlythen, will an ESP credit for the WD be added to the set of ESP creditsin the LSBM 118.

A WD is considered “completed” when the “end of exchange” criteria ismet. This is when all deployment operations (DMOV) are completed and alloutput data received from the accelerator 51 is determined to be equalto the expected output size. The expected output size is indicated inthe WD.

The gateway 52 needs a way for the PPE 123 to signal to the DME 122 whena WD is fully prepared, and this is done by adding an ESP credit to theDME 122 (one could call this a WD credit or an exchange credit as well).A PPE 123 engine running several WDs ahead of the DME 122 is allowed toadd several ESP credits. This prevents the accelerators from having towait for PPE work to complete at each ESP. Optimally, at each ESPtransition, ESP credits should be already available, such that thebarrier can be passed without stalling the accelerator.

One credit represents the ability of the DME 122 to transfer all datafor the first data exchange with the accelerator 52. The PPE 123increments the ESP credits by adding a new credit every time the PPEcompletes data pre-fetch (i.e. completes the pre-work) for the nextsequential ESP. If the PPE 123 pre-loading of data from external nodesis not completed in time for the ESP, the DME 122 will find its ESPcredits to be zero, and the execution stalls until the PPE 123increments the credit count. Stalling one accelerator 51 due to missingdata, will effectively stall the full set of cooperating acceleratorsrunning synchronously (i.e. sharing the same barrier sync network).

Each DMOV instruction is executed by the DME 122 in hardware as a DMAoperation. These DMOV instructions are executed when the gateway pushmodel is applied. The DMOV instructions move data residing in thereferenced data buffer (in gateway memory 114) to its destination. Thatwould normally be an accelerator 51 memory location, but otherdestinations are supported as well.

Since the streaming of data is batched per ESP, the DME 122 will stoptransferring data when the required number of buffers from gatewaymemory 114 are transferred. The number of bytes exchanged per ESP batchis indicated in the WD by parameter fields for both 1) streaming engine124 push operations and for 2) writes into gateway memory 114. It isexpected that the number of bytes to push is equal to number of bytes inall buffers scheduled for the same WD. If there is a mismatch, this willlead to an exception situation.

The DME 122 is configured to use physical memory addresses forretrieving data from memory 114 without the support of a memorymanagement unit (MMU).

For accelerators 51 with dual bus attachments to the gateway 52, thereis no information in the DMOV to indicate which bus the data should bedirected to. The DME 122 controls the selection of the bus, so as tobalance traffic transmitted over the two busses.

The DMOV may be linked to a pre-initialized data buffer in gatewaymemory 114, and thus, in this case, there is no need for a relatedprework instruction to fill the buffer.

Alternatively, a single DMOV (with a single memory data buffer in memory114) may be linked to a set of pre-work instructions for data gatheroperations. Each such referenced pre-work instruction will bring datafrom a specific source and location into the same data buffer atdifferent offsets, thus forming a gather operation. The pre-workinstruction is scheduled in the same WD as the DMOV it prepares datafor. A single pre-work operation may provide data to be pushed byseveral DMOV operations.

The pre/post-work engine instruction sets are executed by thepre/post-work engine implemented in software. There is a need to perform“pre-work” relative to a given ESP and there is a need to perform“post-work” relative to a given ESP.

The autonomous execution of instructions by the PPE may be implementedin the “gateway push” and “Advanced accelerator pull” operationalmodels. PPE 123 uses RDMA, NFS, NVMoF, iSCSI or any other supported fileaccess protocol for moving data to/from gateway external memory/storage114. The execution of the streaming operation is controlled directly bythe PPE instructions found in the “post/pre-work sections” of theexecutable image. The PPE 123 can be viewed as a software basedstreaming processor that takes instructions from the image file andconverts these to local/remote storage operations. These transfers willbe between gateway memory 114 and external memory/storage

The PPE 123 executes in parallel with the DME 122, and since the DME 122depends on the results of the PPE 123, the PPE 123 has to have its workdone before the Data Mover operation performed by the DME 122 isscheduled. This is taken care of in the executable image by groupingtogether, using the work descriptors, DME 122 and PPE 123 instructionsthat belong to the same data exchange synchronisation point.

Each PRW instruction retrieves data from external storage and stores thedata into a pre-compiled data buffer (in gateway memory 114) that thePRW instruction points to. PRW instructions come in different variantsdepending on the source of the data. These variants require differentparameter sets detailing the external IO operation. These details arelooked up in referenced IO templates set up by the control plane via thegateway control channel prior to execution start.

The compiler pre-assigns regions of memory 114 for buffers that arereferenced by PRW instructions. These buffers are used for storing dataretrieved from external storage when the PRW instructions are executed.

The set of ESP credits is incremented by the PPE 123 for each WD whenall pre-work related instructions scheduled for this WD are completed,and only if all pre-work related instructions scheduled for all previousWDs are also completed, and only if all post-work related instructionsthat have an end-criteria on this WD are also completed.

The PRW instructions come in different variants depending on thesource/destination of the data.

The execution order of the PRW instructions is the order in which theyare expressed in the executable image. However, smaller batches of thePRW instructions will be run in parallel to optimize I/O performancefrom remote locations. One or more PRW instruction from one or more WDsare executed in advance of the WD when the data is needed. This isrequired to fill the data “pipeline” to be consumed by the WD. Thegateway 52 has a parallel execution engine for pre-work, allowing it todo this pre-work filling the data “pipeline”.

The completion order for PRW instructions may not be the same as theorder of the instructions in the executable image. Such out of ordercompletion is, however, not a problem since the data ends up in gatewaymemory 114 with no sequence requirements. When it comes to thedeployment sequence of this data to the accelerator 51, the DME 122ensures that the instruction order is that expressed by the executableimage.

A PRW instruction always has an end criteria. The PRW instruction isscheduled by the GW 52 to be completed in due time before a given WD atwhich the supplied data is needed by the accelerator 51. The endcriteria is represented by the WD in which the PRW instruction iscontained. In cases where the data cannot be supplied in time for theWD, the data exchange phase will be delayed until the data is available.This effectively stalls the accelerator 51 compute phase until data isavailable. The occurrence of such stalls are counted, and the feedbackfrom such monitoring will help optimize the gateway and/or the compiler.

The POW instruction does “post-work”, related to a given ESP. Its mainfunction is to move data from gateway memory 114 to an external storage(e.g. host 63 or remote storage 151). The data stored in the gatewaymemory 114 being data received from the accelerator 51. The POWinstruction comes in different variants depending on the destination ofthe data. These variants would need different parameter sets detailingthe external 10 operation.

It is up to the compiler to link a POW instruction to a data buffer inthe memory 114 on which to operate.

For post-work, the instructions may be executed out of order since theresults are not communicated to the accelerator 51, but instead arestored in host 63, remote storage 151 storage or gateway memory 114,where there is no implied semantics related to the write order for puredata.

A POW instruction always has a mandatory start criteria, whichrepresents the earliest point in time at which the instruction may beexecuted. It could be executed later, but not earlier, than themandatory start point. Thus, the POW instruction is triggered for startat a given WD. This trigger WD is represented as the WD in which the POWinstruction is contained. At the completion of the previous WD, theaccelerator 51 must have finished writing to the POW instruction'sbuffer.

There are different types of POW instruction. The first type of POWinstruction involves moving data from local GW memory 114 to the remotestorage 151. This can be configured by the host 63 by instructions (e.g.descriptor 119) sent via the control channel. The second type of POWinstruction involves the moving of data from local gateway memory 114 tohost 63. This can also be configured by the host 63 by instructions sentvia the control channel. The third type of POW instruction involves themanipulation of data stored in the gateway memory 114.

A POW instruction may also have an optional end criteria represented bya parameter of the POW instruction. This may have the following uses.Firstly, this optional end criteria may enable the POW instructions toprepare data for a specific WD, much in the same way as the pre-workinstruction has its end criteria implicitly given by the WD it is partof. Secondly, in cases where the gateway compiler is reusing “output”buffers used by the POW instructions for export to external nodes, it isimportant to protect buffers still holding unsaved data from beingoverwritten by the accelerator 51. In this case, the program can protectbuffers by placing so-called Named Execution Barrier (NEB) instructionsin the DME instruction stream as stop points until all POWs havecompleted flushing buffers, thus freeing buffers for reuse and moreaccelerator 51 output operations. These NEB instructions are describedlater.

If a POW instruction cannot meet its end criteria, the PPE 123 willpause the local DME 122 and consequently all accelerators to be syncedup at the same sync level. The PPE 123 parses a POW instruction andfinds the end criteria. There may be several POW instructions with thesame stop criteria or with different or with no stop criteria.

As mentioned above, the compiler may place stop/pass “executionbarriers” at given execution points in time. The (NEB) instructionrefers to a named “execution barrier” completed (NEBC) object thatcollects the number of completion reports from objects that areinstructed to signal to the NEBC when completed (e.g. POW instructions).

The NEB instruction always belong to a WD, i.e. it is enveloped by theWD. It can be inserted in all three instruction streams (DME, PPE_PREand PPE_POST).

The “stop” state represents a stop signal to the DME/PPE not to proceedwith execution of the instructions in the WD. The other possible stateis “pass”, which allows the DME/PPE to proceed with execution of theirinstructions in the WD, thus passing the NEB instruction. The statechanges from “stop” to “pass” when all the instructions linked to thisend criteria have reported completion by incrementing a“completions_seen” counter in the NEBC object.

The concept of an “execution barrier” is not to be confused with the ESPsynchronisation primitive that may be used to control barriers in theBulk Synchronous Parallel (BSP) memory consistency model. In someexamples, the NEB instruction insertion point is correlated with aspecific ESP for the accelerator program, but there is no such directrequirement. The NEB can be used a generic stop point for all kinds ofsynchronisations.

A first example of the use of the NEB instruction may be given, wherethe NEB instruction(s) is inserted into the WD at the start of the DMEinstruction stream. The NEB represents a pre-condition for executing theDME instructions. The pre-condition is used for controlling the flushingof accelerator output buffers (or ring-buffer fill thresholds) toexternal nodes (e.g. host 63 or remote storage 151) via POWinstructions. The set of ESP credits is not incremented until both: theNEB pre-conditions are met and the PRW instructions are completed. Thismeans that a WD can be cached by the DME, but not executed further ifthere are no ESP credits available. When the PPE 122 has completedexecution of the PRW instructions, it will first check if all NEBinstructions in the WD are in “pass” state. If they are, and all otherpreconditions for giving a credit is met, the credit will beincremented. The DME execution engine will raise an exception if it seesthat the NEB instruction is in stop state. This exception indicates thatthe PPE has wrongly added a credit despite a “stop” state, or that thereis some raise condition in the DME/PPE implementation.

A second example of the use of the NEB instruction may be given, wherethe NEB instruction is inserted into the post-work instruction streamfor flow-controlling data export from the gateway 52 to the host 63. Inthis case, the host 63 controls the state of the NEBC. In this model,the host controls whether or not the PPE 123 is allowed to execute POWinstructions to transfer data to the host 63, thus passing a NEBinstruction. This is controlled by the host providing updates to the“linked” NEBC object's state, to set the state to a “pass” state. Thehost is only allowed to set the “pass” state when all the linked POWinstructions are completed.

An end criteria is always placed on the “next occurrence” of a NEB inthe instruction stream. The “next occurrence” is to be understood asrelative to the execution of the POW.

A third example of the use of the NEB instruction may be given, wherethe NEB instruction is inserted into the pre-work instruction stream forflow-controlling data import feeding from the host 63. In this case, thehost 63 is controlling the state of the NEBC. In this model, the hostcontrols whether or not the PPE 123 is allowed to execute PRWinstructions to transfer data to the memory 114 from the host 63 orremote storage 151, thus passing a NEB instruction. This is controlledby the host 63 providing updates to the “linked” NEBC object's state, toset the state to a “pass” state.

The NEBC object is always initialized in a stop state at the start ofprogram execution. The same reinitialization is performed when startingon the next instruction after the NEB. When setting the state to “stop”,the “completions_seen” is set to zero as well.

In the DME case, the DME 122 itself may not have come so far in itsexecution that the NEB is seen yet, and if all linked instructions arecompleted by the time the NEB instruction is seen, the“completions_seen” is identical to “expected_completions” and the statewill be observed as “pass”, and thus execution continues with nowaiting. Otherwise, the DME 122 waits until all linked instructions arecompleted.

There is one streaming engine 124 per accelerator 51 in a gateway 52,where each streaming engine 124 may run in the various modes that hasbeen described.

There are several streaming engine instances made available across thefabric. There is one streaming engine 124 per accelerator 51, where eachstreaming engine 124 is executing an image. Each streaming engine 124feeds data to an accelerator 51 via one or more high speed buses (e.g.PCIe Gen4).

There are a plurality of different possible streaming flows that may beimplemented using the streaming engine 124. For example, in a firstpossible streaming flow, the gateway 52 may enable the streaming of datato the accelerator 51. This streaming of data may be initiated by afurther accelerator which is configured to provide the data.Alternatively, the streaming of data may be initiated by a DME 122 ofthe gateway 52, which executes instructions to transfer data from memory114 to the accelerator 51. Such data may have been received at thegateway 52 from the host 63 or remote storage 151.

In a second possible streaming flow, the gateway 52 may enable thestreaming of data to a remote accelerator. The accelerator 51 mayprovide packets to the gateway 52 having an address identifying theremote accelerator in a global address space. The gateway 52 isconfigured to use this address to forward the data packet to a furthergateway 128 for deliver to the remote accelerator.

In a third possible streaming flow, the gateway 52 may enable thestreaming of data into the local gateway memory 114. This may be theresult of a local gateway offload. The transfer of data to the memory114 may be from the accelerator 51 at an ESP. The transfer of data tothe memory 114 may be the result of a local RDMA or host RDMA. The datamay be transferred to the memory 114 from external storage, such as thehost 63, the NAS 151 or from the further gateway 128. The transfer ofdata into memory 114 from such external storage is part of the pre-workcarried out by the PPE 123.

In a fourth possible streaming flow, the gateway 52 may enable thestreaming of data into the memory of a further gateway 128. The datatransfer may be initiated by the gateway 52 itself. The data transfermay be initiated by the accelerator 51, which provides packets to thegateway 52 having an address identifying the further gateway 128 in theglobal address space. The transfer of data to further gateway 128 may bethe result of pre-work instructions executed by the further gateway 128to pull the data from the gateway memory 114.

In a fifth possible streaming flow, the gateway 52 may enable thestreaming of data to the remote storage 151. The data is transferredfrom gateway memory 114 to the remote storage 151 by one or more of:RDMA, the Network File System (NFS) protocol, Non-Volatile Memory overFabrics (NVMoF), and the internet Small Computer System Interface(iSCSI) protocol. The data transfer is initiated by the gateway. Thistransfer to the remote storage 151 may result from the execution ofpost-work instructions by the PPE 123.

In a sixth possible streaming flow, the gateway 52 may enable thestreaming of data to the host 63. The data is transferred from thegateway memory 114 to either pinned host memory or RDMA accessible hostmemory. This transfer to the host 63 may result from the execution ofpost-work instructions by the PPE 123.

In a seventh possible streaming flow, the gateway 52 may enable thestreaming of data from one or more remote NFS servers. The data transferfrom these servers may occur in response to a request transmitted by thegateway 52.

As mentioned earlier, parallel programming models for AI and HPC usuallyfollows a 3-phase iterative execution model: Compute, Barrier, andExchange (Data transfer, Collective and Broadcast). The implications arethat accelerators usually requires data transfer to/from accelerator atpre-compiled data exchange synchronization points and/or collectivesexecuted upon accelerator request. The request represents a sync pointwhere the accelerator 51 has finished processing the available data, andnow requires to export some data and requires to import some data. Thegateway 52 will schedule its data movements immediately after anaccelerator exchange request that is acknowledged.

The gateway streaming engine 124 optimizes data movement, thus the databuffer “object” play an important role in holding the data. By passingpointers to buffers (in the gateway memory 114) during execution, thesystem implements zero copy semantics during operation. The data buffersare either pre-initialized in the loaded image, or are filled by the PPE123. In both cases a reference to the buffer in memory 114 may be usedby the DME 122 for transferring data to the accelerator 51 at the ESP.

There may be cases where there is no pre-work required for preparingaccelerator data, such as when data is already prepared and embedded inthe loaded executable image. In such cases, the PPE 123 will also beresponsible for posting ESP credits to the DME 122.

There may also be ESPs where there are no data movement towards theaccelerator 51 (e.g. only accelerator output data), and in such casesthe PPE 123 will also be responsible for posting ESP credits to the DME122. In this case, the PPE 123 will, in response to determining thatthere is no data movement towards the accelerator 51 during an upcomingESP, increment the ESP credits for the upcoming ESP.

It is always the PPE 123 that adds ESP credits.

For the pre-work instructions only: If a WD's pre-work is completedahead of time compared to pre work in earlier issued WDs, the designwill need to queue the pre-work completion info and increase the numberof ESP credits after the handling of all the previous WDs when they havecompleted.

For accelerator data import (i.e. data transfer from gateway 52 toaccelerator 51), the WD describes how many bytes that are to betransferred in both directions (i.e. between accelerator 51 and gateway52) during an exchange. The accelerator 51 in the push model has, as aresult of the compilation, the same information and thus knows when allexpected data is received for this exchange, and starts the computephase immediately after all data is received. In the pull model, theaccelerator 51 controls when the exchange is over by stopping thereading of the data from the gateway 52.

For accelerator data export: The accelerator 51 knows from its compiledcode how much data to send to gateway 52 for a given ESP, and thegateway 52 knows how many to expect by reading this information from theWD.

When the gateway 52 has received the exact number of bytes expected fromthe accelerator 51, it will move on to execute the next WD. In executingthe next WD, the gateway 52 may perform post-work comprising localoperation on data in the gateway memory 114. Additionally oralternatively, the gateway 52 may perform post-work to transfer the datato its final destination. Alternatively, the gateway 52 may perform nopost-work. For example, it may let the data stay in gateway memory 114,allowing the memory 114 to function as an off-accelerator data cache forlater read back. In executing the next WD, the gateway 52 may performpre-work needed to be completed prior to the next ESP. Additionally oralternatively, the gateway 52 may perform DMOV instructions to beexecuted after the next ESP. If there are ESP credits available, theDMOV instructions are used for pre-loading data to the gateway transfermemory 127 in advance of the ESP. If there are no ESP credits, the DME122 awaits ESP credits, and when ESP credits are available performspre-loading.

If the PPE instructions—i.e. both post-work (POW) and pre-work (PRW)instructions—are targeting remote storage 114 for static data that isknown to be already available on a storage node, then there is no needfor data synchronization with that node as long as the gateway supportsthe storage protocol for direct access to the data.

The host 63 memory is small relative to the amount of data which it istransferring to the gateway 52 and accelerator 51, so the host 63 needsto bring the data into its memory “piece by piece”. Due to this “pieceby piece” nature, there needs to be a synchronization mechanism betweenthe gateway 52 and host 63 controlling when data is available forgateway 52 initiated RDMA reads (gateway data import). Likewise, for thegateway 52 initiated RDMA writes (i.e. gateway data export), a similarsynchronization is needed. The challenge for the total AI appliance isto have data streaming continuously in and out of thegateway/accelerator, so such a synchronization mechanism is vital to AIperformance. The system needs a well-designed solution with minimaloverhead for this to scale to large AI fabrics.

The streaming engine 123 has several modes of operation for moving databetween gateway and host.

In a first mode of operation, the streaming engine 124 runs as a slaveof the host 63 under commands from the host 63. In a second mode ofoperation, the streaming engine 124 executes based on pre-compiledinstructions stored in its code memory.

In the first mode of operation, the streaming engine 124 acts as a slaveof the host 63 and performs the operations of storing data in memory114, and retrieving said data from memory 114 for delivery to theaccelerator 51, under the control of the host 63.

In the second mode of operation, the streaming engine 124 prefetchesdata from the host 63 or remote storage 151 in dependence upon apre-complied executable file derived from the compiler that is used togenerate the code of a complete system composed of accelerators andgateways. Since the compiler is used to generate code for the gateway52, which fetches the data to be delivered to the accelerator 51, andthe accelerator 51, which processes the data, the host 63, the gateway52 and the accelerator 51 are able to act in sync with one another. Thegateway 52 file anticipates the data needed by the accelerator 51,prepares that data for deployment in advance of the associated computephase by storing it in memory 114. The gateway 52 prepares the data fortransfer to the accelerator 51 at the appropriate time in dependenceupon the code generated by the compiler. The DME 122 transfers it to theaccelerator 51 in a latency optimized manner at precisely the right timefor the accelerator 51, in response to a sync request 56 from theaccelerator 51. The DME 122 sits close to the accelerator 51 for latencyoptimised delivery.

In a third mode of operation, the accelerator 51 informs the gateway 52in advance of the next N barriers what data to prepare for transfer tothe accelerator 51 from memory 114 for the corresponding N barriers. Inthis mode of operation, the accelerator compiler can foresee future I/Ooperations and thus schedule such commands to the gateway 52 so that thegateway 52 has adequate time for delivery of the data.

A compiler produces a set of computer code instructions that areexecuted by the accelerator 51. These sets of computer code instructionsmay be referred to as executable images. In some embodiments (e.g. inthe second mode of operation described above), the compiler may alsoproduce a related set of streaming engine data movement/processingcommands that are fulfilled by the gateway 52.

The compiler produces one executable image per streaming engine. Theexecutable image references a flat contiguous XPU Virtual Address (XVA)space as seen from an accelerator. This XVA space covers internalaccelerator memory as well as “Streaming Engine sandbox” memory mappedvia memory management unit (MMU) mappings into the same XVA space. Theexecution image also references a “host sandbox” virtual address (HSVA)space that covers the required host memory accessible to the streamingengine 122. This HSVA space is relevant in the GW operational model: “GWpush model” and the “Advanced XPU pull model”.

Within these two virtual address spaces (XVA and HSVA), the compiler isresponsible for defining the existence of buffer resources andaddressable elements needed by the streaming engine 122, accelerator 51and host 63.

The compiler is also responsible for defining reuse of gateway buffersin memory 114 between iterations and sequences of WDs as it sees fit andwhen needed due to limited gateway memory 114. Buffer reuseoptimizations are not required as long as there is enough memoryassigned to the gateway 52.

For a gateway 52 configured to communicate with two or moreaccelerators, it is currently not possible for one accelerator to accessthe streaming engine sandbox assigned to other accelerators. This isenforced by MMU setup inside each accelerator or accelerator supportchip. The XVA space of the different accelerators doesn't overlap inphysical gateway memory. Streaming engines run in their separate “XPUsandboxes” and all access is runtime enforced to stay within its ownsandbox. Due to the accelerator's on-board MMU, it may be possible toconstruct a common memory region that is shared between these streamingengines.

Referring again to the transfer of data to the accelerator illustratedin FIG. 7, in some examples, the gateway 52 receives the data from thehost 63 or remote storage 151 and stores it in memory 114 before makingit available in a fast gateway transfer memory 127 for transfer to theaccelerator 51. The DME 122 pre-loads the fast gateway transfer memory127 from memory 114 in dependence upon the DME instructions. Thecontents of the gateway transfer memory 127 are transferred to theaccelerator 51 in response to the completion of a handshake request.This pre-loading into the gateway transfer memory 127 is used in thepush model described above. Similarly, in the pull model, pre-loadinginto the gateway transfer memory 1610 is carried out. In some examples,the pre-loading of the either or both of the gateway transfer memories127/1610 is carried out only if the number of ESP credits is greaterthan zero.

Reference is made to FIG. 14, which illustrates how the preparation ofdata, its exchange between the gateway 52 and accelerator 51 and theprocessing of this data are related. The prepare and deploy stages areperformed by the gateway 52, whereas the compute stages are performed bythe accelerator 51. Data is prepared by the gateway 52 in advance of theassociated compute phase. The data is stored as closely as possible tothe accelerator 51. When the accelerator 51 is able to accept the dataand indicates as such by sending a sync request 56 to the gateway 52,the gateway 52 deploys the data using the full capacity of the port/slinked to the accelerator 51 with no external dependencies. As thedeployed data is being processed by the accelerator 51, the gateway 52prepares the next phase of data to be deployed. The engine scales itsoperation across all available gateway data centre ports.

The gateway 52 is able to receive data from the host 63 or remotestorage 151 and perform storage and preparation processing (e.g.augmentation) of data that is needed by additional gateways. This datamay be transferred to the additional gateways. The data transferred tothe additional gateways may then be provided to accelerators associatedwith those additional gateways. This may be useful for avoidingbottlenecks. For example, instead of each gateway independentlyretrieving data from a remote storage 151, and hence causing abottleneck at the access to the remote storage 151, one gateway 52 mayretrieve data from the remote storage 151 and provide said data to aplurality of gateways. This may address the problem of a bottleneck whenaccessing the remote storage 151. Furthermore, this approach is able toreduce the amount of storage required. If each accelerator is connectedto an associated host with its own storage, then the number of hosts andthe amount of storage scales with the number of accelerators. By havinga gateway that is able to retrieve data from external storage forprovision to multiple accelerators, the amount of storage can be scaledindependently of the number of accelerators. In this case, the amount ofstorage can be better tuned to the actual data requirements of theaccelerators. The overall amount of storage in the system may be reducedwith more efficient use of the remaining storage resourced being made.

When the gateway 52 receives data—e.g. from external storage, anaccelerator, or from another gateway—before the data is streamed out thegateway—e.g. to an external storage, to the accelerator 51, or to afurther gateway 128—the gateway 52 may perform one or more datapreparation operations on the data. The possible operations include oneor more of compression, decompression, decryption, and/or a number oftypes of data augmentation. The gateway 52 performs these operations onthe data so as to reduce the pressure on the processing and storageresources at the external storage and other gateways. For example, itmay be impractical for all of the necessary data preparation to becarried out prior to the data being placed in the external storage asthis may greatly increase the amount of processing resources requiredprior to storage and/or violate the security of the data storage.Therefore, according to embodiments of the application, data preparationoperations are exported to one or more gateways of the system.

According to one example, when the gateway 52 receives the data from thehost 63 or remote storage 151, prior to providing this data to theaccelerator 51, the gateway 52 processes the data. This processing maybe carried out by the streaming engine 124. The processing may compriseone or more of: data augmentation (e.g. noise injection), decompression,decoding (e.g. of image and video data, such as JPEG format images andH264 format video).

To keep memory usage minimal, data is compressed when it is loaded intothe gateway 52 and decompressed at the latest possible time beforedelivery to the accelerator 51. The gateway 52 may provide a latencyoptimized hardware decompression engine (not shown) for certain types ofcompression. Additionally, decompression can be implemented in gatewaysoftware to provide extended support for any arbitrary compressionalgorithm.

The compression of data (which is part of the data preparationprocessing) may be part of the pre-work carried out by the streamingengine 124 of the gateway 52 that is carried out when data is loadedinto the memory 114, e.g. from external storage, another gateway, or anassociated accelerator. The compressed data is then stored in the memory114. The compression reduces the burden placed on the limited space ofmemory 114. At a later time, the data is loaded from the memory 114 fortransfer out of the gateway, e.g. to accelerator 51, a further gateway128, or external storage. When the data is loaded from the memory 114,the data is decompressed by the streaming engine 124, prior to beingtransferred out of the gateway. The decompression is performed by thedata mover engine 122 of the gateway 52.

By performing data preparation (e.g. augmentation) in the gateway 52,the original data can be stored once, in its original format, andfetched once. That data can then be replicated to multiple acceleratorswith different preparation settings applied, by the gateway 52, to eachreplicated copy. The gateway 52 provides a set of preparation methods inhardware and provides the ability for gateway software to implementdifferent algorithms for said preparation.

Sets of data that have been streamed into the gateway 52 may be providedto different accelerators with different settings applied. In somecases, a set of data streamed into the gateway 52 is replicated andprovided to different accelerators with different preparation settingsapplied. One or more of these copies is sent to accelerator/s directlyconnected to the gateway 52 via an accelerator interface of the gateway52. One or more of the copies is sent to one or more different gateways,with those different gateways being configured to provide the data setsto their respective accelerators. In other examples, data streamed intothe gateway 52 from external storage is sharded. In this case, the datastreamed into the gateway 52 is divided into different sets. One or moreof these sets are sent to accelerator/s directly connected to thegateway 52 via an accelerator interface of the gateway 52. One or moreof the data sets are sent to one or more different gateways, withdifferent gateways being configured to provide the data sets to theirrespective accelerators.

In some embodiments, as noted, the gateway 52 is configured to providedata sets (whether replicated or sharded) to one or more furthergateways with different data preparation settings applied. Each of thefurther gateways is configured to then provide the received data set toits associated accelerator, such that the accelerators receive data withdifferent preparation settings applied. The different gateways thatreceive the copies of data from gateway 52 may themselves apply datapreparation operations to the data prior to the data being provided totheir respective accelerators.

In some embodiments, the gateway 52 is configured to provide data sets(whether replicated or sharded) to one or more further gateways withoutapplying different preparation settings to each replicated set. Each ofthe one or more further gateways that receives a data set is configuredto apply different preparation settings to the data set that itreceives. Each of the gateways then provides its data set with theparticular data preparation operations performed to its associatedaccelerator.

Reference is made to FIG. 19, which illustrates a system 1900 in which adata set is replicated and prepared with different settings beingapplied for the different replicated data sets. These replicated datasets are then provided to different accelerators. This may provide aform of a data parallelism, whereby the same model is executed bydifferent accelerators on varying data sets.

The system 1900 comprises an external storage 1905 configured to storean original data set (labelled ‘O’ in the Figure), which is to bereplicated. The external storage 1905 may be a host or network attachedstorage. The original data set is provided to the gateway 52 from theexternal storage 1905 and stored in memory 114 (using the streamingtechniques discussed previously) of the gateway 52.

The gateway 52 comprises a data processing engine 1910 that isconfigured to replicate and perform preparation operations on theoriginal data set. The data processing engine 1910 that performs thedata preparation operations comprises at least one processor thatperforms the data preparation operations. The data processing engine1910 may be the streaming engine 124, as described previously. The dataprocessing engine 1910 is configured to receive the original data set,replicate the original data set, and perform different preparationoperations on the different replicated data sets.

In some embodiments, the data preparation is implemented in software,with the data processing engine 1910 being configured to executecomputer readable instructions to perform the data preparationoperations. The data processing engine 1910 in this case is part of asystem on chip (SoC) of the gateway 52.

In some embodiments, the data preparation is performed in hardware. Thedata processing engine 1910, in this case, comprises a hardware moduleconfigured to perform the data preparation processing. The hardwaremodule may comprises a field programmable gate array (FPGA) configuredto perform the processing.

In some embodiments, the data preparation is performed in a combinationof software and hardware. The data processing engine 1910 of the gatewaymay comprises a CPU for performing programmable data preparationoperations. The data processing engine 1910 may also comprise custombuilt hardware for performing data preparation operations. In this case,the custom built hardware is used to perform common data preparationoperations that are performed frequently, with the CPU being used toperform data preparation operations that are less frequently required.

In this example, the data processing engine 1910 performs first datapreparation operations on a copy of the original data set to generate afirst prepared data set (labelled as “A” in the Figure). The dataprocessing engine 1910 performs second data preparation operations on acopy of the original data set to generate a second prepared data set(labelled as “B” in the Figure). The data processing engine 1910performs third data preparation operations on a copy of the originaldata set to generate a third prepared data set (labelled as “C” in theFigure). The data processing engine 1910 performs fourth datapreparation operations on a copy of the original data set to generate afourth prepared data set (labelled as “D” in the Figure).

The streaming engine of the gateway 52 is configured to provide thefirst prepared data set to the accelerator 51 in response to apre-compiled ESP being attained by the accelerator 51. The streamingengine of the gateway 52 is also configured to provide the secondprepared data set to the accelerator 51 a in response to a pre-compiledESP being attained by the accelerator 51 a.

The gateway 52 provides the third prepared data set to the neighbouringfurther gateway 128. In some embodiments, the streaming engine of thefurther gateway 128 is configured to execute pre-work instructions topull the third prepared data set from the memory 114 of the gateway 52into the memory 114 a of the further gateway 128. In some embodiments,the streaming engine of the gateway 52 is configured to execute datamover instructions to push the third prepared data set from the memory114 of the gateway 52 to the memory 114 a of the further gateway 128.

The further gateway 128 is then configured to provide the third prepareddata set to the accelerator 51 b in response to a pre-compiled ESP beingattained by the accelerator 51 b.

The gateway 52 provides the fourth prepared data set to the thirdgateway 128 a (via the further gateway 128) in advance of an ESPattained by the accelerator 51 c. In some embodiments, the streamingengine of the further gateway 128 is configured to execute pre-workinstructions to pull the fourth data set from the memory 114 and storethe fourth prepared data set in its local memory 114 a. In someembodiments, the streaming engine of the gateway 52 is configured toexecute data mover instructions to push the fourth prepared data setfrom the memory 114 of the gateway 52 to the memory 114 a of the furthergateway 128. Optionally, the data processing engine 1910 a of thefurther gateway 128 is configured to perform one or more furtherpreparation operations on the fourth prepared data set to generate amodified fourth prepared data set (labelled “D′”). The streaming engineof the third gateway 128 a is then configured to execute pre-workinstructions to pull the modified fourth prepared data set from thememory 114 a into its local memory 114 b. The third gateway 128 a thenprovides the modified fourth prepared data set to the accelerator 51 cin response to a pre-compiled ESP being attained by the accelerator 51c.

In this manner, data with different preparation settings may be providedto different accelerators. This allows, for example, the same set ofdata with different types of augmentation to be delivered toaccelerators and processed in parallel by the accelerators. It alsoallows the same set of data with the same type of augmentation applied,but using different parameters, to be delivered to accelerators andprocessed in parallel by the accelerators.

Reference is made to FIG. 18, which illustrates an example hardwaremodule 1800 which is configured to perform data preparation operationson data received at a gateway, such as gateway 52. The hardware module1800 is not itself a general purpose processor, but may comprise generalpurpose processors, such as CPUs, that are configured to perform certaintypes of processing.

The data is received at the gateway 52 from external storage or fromanother gateway and stored in the memory 114. The data preparationoperations are then performed on the data stored in this memory 114prior to the data being streamed out of the gateway to an externalentity (such as accelerator 51, further gateway 128, or external storage1905)

The hardware module 1800 comprises a direct memory access (DMA) engine1805, which is programmed with the locations in memory 114 of the dataon which the preparation operations are to be performed. The DMA engine1805 is configured to retrieve the data from the memory 114 for thepreparation processing. The DMA engine 1805 is also programmed withindications of the processing steps that should be performed for eachdata set retrieved from memory 114. The data preparation commandscomprise such indications. The data preparation commands are included inthe DMA descriptors used for performing the transfer from memory 114.

The DMA engine 1805 performs gather operations to pull the data frommemory 114. Once the preparation processing is complete, the DMA engine1805 may return the data to the memory 114. The DMA engine 1805 performsscatter operations to return the data back to the memory 114 once thepreparation processing is complete. Alternatively, after the preparationoperations are complete, the data may be delivered to the gatewaytransfer memory 127/161 for delivery to the accelerator 51 at theupcoming ESP without being transferred back to the memory 114. Asanother alternative, the data may be pushed to a further gateway 128 inscatter operations once the preparation processing of that data iscomplete.

Scatter-Gather refers to the ability of the DMA engine 1805 to operateon multiple memory locations in the same DMA operation. In a gatheroperation, different portions of data stored discontiguously in memorythat have similar processing requirements may be retrieved andpreparation processed as part of a single stream. In a scatteroperation, different portions of data that have undergone preparationmay be provided to different destinations.

The DMA engine 1805 comprises a read descriptor list for performing thegather operations. Each descriptor in the read descriptor list points toa memory location at which data is to be read from. The DMA engine 1805moves through the descriptor list and reads data for preparationprocessing from the relevant locations pointed to in memory 114. Thesegather operations allow the DMA engine 1805 to pull data from differentlocations in memory 114 to be preparation processed (and, optionally,output) as a single stream. Different sets of data may be present atdifferent locations in memory following several iterations of sharding(discussed above) data sets to different gateways. The gather operationperformed by the DMA engine 1805 usefully allows these data sets atdifferent locations to be gathered from the memory 114 of the gateway 52and processed and provided to the accelerator 51 as a single stream.

The DMA engine 1805 comprises a write descriptor list for performing thescatter operations. Each descriptor in the write descriptor list pointsto a memory location to which data is to be written. The DMA engine 1805moves through the descriptor list and provides data that has beenpreparation processed to the locations indicated in the writedescriptors. As noted, the scatter operations provide data to differentlocations. This may be useful for performing the provision of differentdata sets (either sharded data sets or replicated data sets) todifferent gateways as discussed. A scatter operation is executed by theDMA engine 1805 to provide different sets of data that have undergonedifferent preparation processing to different gateways. Following theprovision of data to different gateways, those gateway provide the datasets to their respective accelerators.

The DMA engine 1805 passes the retrieved data to the data preparationengine 1810 along with the data preparation commands. The hardwaremodule 1800 comprises a plurality of different engines configured toperform different types of processing. The hardware module 1800comprises one or more of: a data augmentation engine 1815, a decryptionengine 1820, a decompression engine 1825, and a programmable engine1830. The data preparation engine 1810 is configured to send thereceived data to at least one of these engines selected in dependenceupon the processing indicated in the relevant data preparation commandsfor that data.

The data augmentation engine 1815 is configured to perform augmentationof data that it receives from the data preparation engine 1810. Theaugmentations performed by data augmentation engine 1815 may include anyarbitrary data augmentation operations. The augmentation may includenoise injection and/or Tensor Flow augmentations. The Tensor Flowaugmentations include one or more of adjusting contrast, adjusting hue,adjusting saturation, cropping, resizing, cropping and resizinggradboxes, cropping and resizing gradimage, drawing boundary boxes,extracting glimpse, extracting JPG shape, converting from HSV format toRGB format, converting from RGB format to HSV format, non maxsuppression, quantised resize bilinear, resizing area, resizing bicubic,resizing bilinear, resizing nearest neighbour, sample distorted boundingbox.

The decryption engine 1820 is configured to decrypt data that itreceives from the data preparation engine 1810.

The compression/decompression engine 1825 is configured to compress ordecompress data that it receives from the data preparation engine 1810.The compression/decompression engine 1825 may apply Tensor Flowfunctions to data that it receives from the data preparation engine1810. The list of relevant Tensor flow functions that may be performedby the compression/decompression engine 1825 includes decode BMP, decodeGIF, decode JPEG, decode PNG, encode JPEG, and encode PNG.

The programmable engine 1830 is configured to perform preparation ofdata that it receives from the data preparation engine 1810. Thepreparation operations performed by the programmable engine 1830 areuser programmable, such that the programmable engine 1830 isprogrammable to perform any arbitrary preparation operations. Theprogrammable engine 1830 comprises a programmable core, e.g. a CPU core,to perform these functions.

The hardware module 1800 comprises one or more FPGAs for performing oneor more of the data preparation operations. For example, the dataaugmentation engine 1815, decryption engine 1820, and decompressionengine 1825 may all comprise FPGAs configured to perform the respectiveprocessing associated with that engine.

The one or more FPGAs of the hardware module 1800 are partiallyreconfigurable. The FPGAs are configured to provide a library ofpreparation operations. The operations that an FPGA is configured toperformed on data can be changed at run time.

The programmable engine 1830 comprises a processor configured to providea runtime support that is responsible for the hardware engines 1815,1820, 1825 plus the processing of the programmable engine. The runtimesupport is configured to perform the programing of the FPGAs to modifythe data preparation operations performed by those FPGAs. The runtimesupport loads new operations to the FPGAs to be performed on the datasets received at the gateway.

The runtime support is configured to modify the operations on a perprogram basis. In this case, a different set of data preparationoperations are provided by an FPGA for different programs running on theaccelerator. Additionally or alternatively, an FPGA can be configured toperform different preparation operations during running of a program.Data preparation designs are loaded to the FPGAs at run time to modifythe data preparation operations performed on received data. This can beperformed for some or all of the FPGAs provided in the data augmentationengine 1815, decryption engine 1820, and decompression engine 1825.

The data preparation engine 1810 is further configured to, following thepreparation operations, control the delivery of data to its destinationin the gateway. The data preparation engine 1810 is configured to,following the preparation operations, send the data to one or more of:the memory 114, the gateway transfer memory 127/161, an acceleratorinterface for transfer to the accelerator 51, a gateway interface fortransfer to a further gateway 12, and a data connection interface fortransfer to the external storage.

In one embodiment, the streaming engine 124 provides two dataacceleration features. The streaming function provides a replicatefeature and a replicate and transpose feature. This allows training datato be replicated from one gateway to any other gateway, thus reducingthe IO connectivity need.

The data is received at the gateway 52 from the host 63 or remotestorage 151 and is stored (after traversing path 120) in the memory 114by the PPE 123. The DME 122 retrieves the data to be sent along path 121from the memory 114 and causes the data to be sent to the accelerator51. The data is sent to the accelerator 51 from the memory 114 via theindicated accelerator ports. Data transfer along the path 121 istriggered by the sync signals as described already.

The gateway 52 allows the provision of data to the accelerator 51 (whichinvolves transfer of the data over the path 121) to be decoupled fromthe retrieval of the data from the host 63 or remote storage 151. Inother words, the gateway 52 enables the transfer of data from the host63 or remote storage 151 to proceed ahead of the computation performedby the accelerator 51.

FIG. 8 illustrates two further data paths that allow exchange of databetween the gateway 52 and further gateways. The gateway 52 includes apath 125 from which data may be transferred between the accelerator 51(coupled to the gateway 52 by the accelerator ports shown) and a furtheraccelerator (not shown) via a further gateway 128 (coupled to thegateway 52 by the fabric ports shown). The gateway 52 and the furthergateway 128 act as switches on this path 125 and enable an extended dataexchange fabric between accelerators. The further gateway 128 may beconfigured to transfer data to/from a further host to which it isconnected. The data transfer along this path 125 may be unicast (i.e.data directed to a single accelerator), broadcast (data transmittedwithout being directed to specified accelerators) and multicast (datadirected to multiple specified accelerators). In broadcast mode, packetssent on the fabric port contain a Multicast Group ID. Each gateway has atable which contains a list of destinations for each multicast group ID.When the gateway receives such a packet, it looks up in the table, thelist of destinations corresponding to the multicast group ID included inthe packet and transmits the packet to those destinations.

In one embodiment the XPU Ports are a custom Root Complex implementationproviding specialized data movement capabilities. In addition totransferring packets to/from the gateway memory 114, the XPU Ports alsoprovide a peer-to-peer capability to/from the Fabric Ports. Packetswhich are targeting memory space mapping to a remote accelerator aredetected at the XPU Port and directed towards the appropriate fabricport. The receiving Fabric Port will direct the packet to the correctdestination accelerator port. Also, gateways can forward packets fromone fabric port to another fabric port. This allows arbitrarily largefabrics to be traversed. In this way, full accelerator to acceleratorexchange is enabled through the gateway fabric.

FIG. 8 also illustrates a data path 126 for exchanging data between thegateway 52 and a further gateway. The data path 126 is used for theexchange of synchronisation and management messages between the gateway52 and the further gateway 128. Additionally, the data path 126 is usedto exchange data between the memory 114 associated with gateway 52 and amemory associated with the further gateway 128. The data exchanged viadata path 126 is exchanged as part of the pre-work, when pre-workinstructions are executed by the PPE 123.

Data may be transferred from the memory of the further gateway 128 tothe memory 114 in response to the execution of pre-work instructions bythe PPE 123. This data is then available in memory 114 for transfer(e.g. by a PCIe read operation from the accelerator or by the executionof a DMOV instruction by the DME 122) to the accelerator 52 at theupcoming ESP. When the PPE 123 completes execution of the pre-workinstructions for transferring data into its memory 114, it incrementsits set of ESP credits.

As noted earlier, a sync zone/group may include a plurality of gateways.In such a case, instead of, or as well as, a sync request being receivedfrom the associated accelerator 51, a sync request may be received atthe gateway 52 from a further gateway 128. In this case, this othergateway 128 may be referred to as a “downstream gateway”.

Reference is now made to FIG. 15, which shows the gateway 52 incommunication with the further gateway 128 and, additionally, a thirdgateway 152. When the sync request 129 is received from the furthergateway 128, the gateway 52 may allow the synchronisation barrier to bepassed by transmitting a sync request 153 upstream to a third gateway inthe case that the gateway 52 is not a synch master (i.e. the gateway 52is a synch slave). The sync request 129 may first be aggregated with oneor more sync requests (e.g. sync request 56) received from the localaccelerators (e.g. accelerator 51). In this case, it is this aggregatedsync request 153 that is transmitted upstream to the third gateway.

Alternatively, and for example when gateway 152 is not connected to thesync zone of gateway 52 when the sync request 129 is received from theother gateway 128, the gateway 52 may allow the synchronisation barrierto be passed by sending a sync acknowledgment 154 to the further gateway128 in the case that the gateway 52 is a master gateway. In the casethat the gateway 128 is the master gateway, any sync requests receivedfrom the local accelerators (e.g. accelerator 51) are also acknowledged(e.g. by transmitting acknowledgement 155) given that sync-requests arereceived from all configured down-stream gateways.

The ESP credits in the LSBM 118 held by the gateway 52 may be used tocontrol the synchronisation request forwarding between the gateway 52and the further gateway 128. As with the barrier between the accelerator51 and the gateway 52, the ESP credits are only used to control thesynchronisation request forwarding between the gateway 52 and thefurther gateway 128 in the case that gateway involvement is indicated bya local accelerator (e.g. accelerator 51) that sends a sync request 155to the gateway 52. This indication may be stored in register 59 asdescribed earlier. If no gateway involvement is indicated, when the syncrequest 129 is received, the sync request 153 is sent upstream and whena sync acknowledgment 154 is returned, the synchronisation barrier ispassed.

Assuming gateway involvement by the accelerator 51 is indicated, if thenumber of the ESP credits associated with the accelerator 51 isnon-zero, and the gateway 52 has received sync request 129 from adownstream gateway 128, if the gateway 52 is not the sync master gateway(i.e. is a sync slave gateway), the barrier is passed upstream. The syncrequest 129 is aggregated with a sync request 56 from the accelerator 51to form sync request 153 which is transmitted to an upstream gateway152. The ESP credits in each LSBM 118 in the sync chain are decrementedupon receiving a sync ack 156 corresponding to the sync request 153 fora synchronisation requiring gateway involvement.

Assuming gateway involvement by the accelerator 51 is indicated, if thenumber of the ESP credits associated with the accelerator 51 isnon-zero, and the gateway 52 has received sync request 129 from adownstream gateway, if the gateway 52 is the sync master gateway it willsend a sync acknowledgment 154 to the downstream gateway 128 and to itsown streaming engine(s) 124. Upon reception of the sync acknowledgment,the streaming engine 124 decrements the number of ESP Credits held bythe LSBM 118.

Thus, the LSPM 117 of the gateway 52 can prevent propagation of syncrequests to other gateways (i.e. LSPMs) in the absence of ESP credits inthe LSBM 118. This ensures that when an acknowledgement is finallygenerated by the sync master, all accelerators will start to executetheir superstep at the same time.

The gateway 52 includes a plurality of interfaces, e.g. an interface tothe accelerator 51, an interface to the further gateway 128, aninterface to the third gateway 152. The gateway 52 includes a registerindicating the directionality of each of these interfaces for syncpurposes, i.e. whether the entity such as the further gateway 128 isupstream or downstream of the gateway 52. Hence, the register indicatesto which interfaces, sync requests are to be sent over by the gateway 52in response to the gateway 52 receiving a sync request from a downstreamentity. In the case that the register indicates that none of theinterfaces are for transmission of the sync request, this indicates thatthe gateway 52 is the sync master. In this case, the gateway 52transmits sync acknowledgments over all of the interfaces over which ithas received sync requests.

In the case that the gateway 52 functions as slave gateway, it mayreceive one or more sync requests from the accelerators (e.g.accelerator 51) that are associated with it. These sync requests areaggregated by the gateway 52 which then passes them upstream to thefurther gateway 128 (assuming there are ESP credits available for eachlocal accelerator indicating gateway involvement from it receives syncrequests). Assuming the further gateway 128 is also a slave, thatfurther gateway gathers that request, and all sync requests from its ownlocal accelerators and then forwards a new aggregated sync request tothe next gateway (assuming there are ESP credits available for eachlocal accelerator indicating gateway involvement from it receives syncrequests). This happens in parallel across the sync network. Eventuallythe master gateway receives sync requests from all downstream gatewaysand its own associated accelerators. Then, and only then, is the synccompleted and the sync acknowledgments generated by the master gateway(assuming there are ESP credits available for each local acceleratorindicating gateway involvement from it receives sync requests) and sentdownstream to the entites (i.e. local accelerators or downstreamgateways) from which it received sync requests. Each gateway downstreamwhich receives a sync ack will transmit a sync ack to the entities fromwhich it received sync requests.

As noted, sync requests may be received at gateway 52 from a pluralityof local accelerators (not just the example accelerator 51). Eachaccelerator is associated with a different set of ESP credits. Only ifall the ESP credits for each accelerator from which a sync request (andwhich indicates gateway involvement) has been received is non-zero willthe gateway 52 pass the aggregated sync request upstream (in the casethat it is a slave) or acknowledge the sync request (in the case that itis the master).

As previously, following transmission of a sync acknowledgment to theaccelerator 51, the gateway 52 is configured to exchange data with theaccelerator 51.

Reference is made to FIG. 10, which illustrates the gateway functionthat is implemented by the streaming engine 124. The PPE 123 executes inparallel with the DME 122, but as the DME 122 depends upon the resultsof the PPE 123, the PPE 123 needs to provide its results before a DMEoperation is scheduled. This is handled in either the executable image,that is pre-compiled, or through user program sequencing of commandsdelivered to the gateway 52 from the accelerator 51.

As shown in FIG. 10, there is a module 142 (shown as a GDxSM module)that sits between the PPE 123 and the network stack 141. The GDxSMmodule 142 comprises two modules, i.e. a GW data import synchronisationmodule (GDISM) and a GW data export synchronisation module (GDESM). Bothmodules handle synchronization of I/O buffer elements between thegateway and host.

The synchronization is flow-controlled, and ensures GW data consistencyand readiness for IO operations at the exchange synchronization points(ESPs).

The first set of credits (which has already been discussed in detail)are the ESP credits. The ESP credits govern the passing of thesynchronisation barriers either between the accelerator 51 and thegateway 52 or between the gateway 52 and the further gateway 128. Usingthe ESP credits, a barrier credit mechanism is used to control thetransfer of data between the gateway 52 and the accelerator 51.Availability of one ESP credit implies that a data exchange operationcan be executed for one barrier.

A second set of credits governs the transfer of data to the gateway 52(either from the host 63, remote storage 151 or further gateway 128).These credits are stored by the GDxSM 142. More specifically, thesecredits are stored in the GDISM of the GBxSM 142. The second set ofcredits may be referred to as GDISM credits. The skilled person wouldunderstand that the term “GDISM credits” is a name only, and that thecredits are not limited in their nature by this name.

The gateway 52 executes pre-work instructions to retrieve data from thehost 63, remote storage 151 or a further gateway 128 in response todetermining that there are a non-zero number of GDISM credits available.The gateway 52 does not retrieve the data if it determines that thereare zero GDISM credits available. The host 63 sends an instruction toupdate/increment the GDISM credits using RDMA to send the instruction.When the streaming engine 124 is notified via an RDMA write from host 63of an update to the GDISM credits register, it will update the creditsregister accordingly. The gateway 52 decrements the number of GDISMcredits stored in response to pre-work being completed by the PPE 123.The pre-work being to transfer data to the gateway 52 from an externalstorage.

The GDISM credit control mechanism may prevent the pre-work (PRW)instructions from being executed too early. The GDISM controls how manyWDs ahead of the currently executing ESP, the pre-work (PRW) engine isallowed to work.

The host 63 may be configured to perform the same credit update for theGDISM credits for a group of gateways. The credit update is performedusing RDMA and a protocol on top of RDMA to make a reliable broadcast.This may be needed in the case that a sync group includes a plurality ofgateways. In this case, the group of gateways may need to have the samenumber of GDISM credits available, otherwise one of the accelerators maystall and hence stop all of the other accelerators.

In some examples, GDISM credits are also used for controlling thetransfer of data from the gateway to the host. The same set of GDISMcredits (i.e. the second set described above) that is used for thetransfer of data from the external storage to the gateway 52 may be usedto control the transfer of data from the gateway 52 to the externalstorage (e.g. host 63, remote storage 151). In response to the gateway52 sending the data to the external storage, these GDISM credits thatrepresent both import and export credits are decremented when the PPE123 completes its commands in a WD. The gateway 128 will only transmitdata to the external storage if the number of GDISM credits is non-zero.

In this way, the GDISM credits may be used to throttle the POWinstructions as well as the PRW instructions. A POW instruction cannotbe executed if the number of GDISM credits is non-zero. In the case thatGDISM credits control transfer of data both to and from the externalstorage, a single GDISM credit is consumed only when all the POWinstructions and PRW instructions are completed for a given ESP.

In some examples, a third set of credits governs the transfer of datafrom the gateway 52 to the host 63 or the remote storage 151. Thesecredits are stored by the GDxSM 142. More specifically, these creditsare stored in the GDESM of the GBxSM 142. The third set of credits maybe referred to as GDESM credits. The skilled person would understandthat the term “GDESM credits” is a name only, and that the credits arenot limited in their nature by this name.

The gateway 128 will only transmit data to the external storage if thenumber of GDESM credits is non-zero. In response to the gateway 52sending the data to the external storage, the GDESM credits aredecremented. In this way, the GDESM credits may be used to throttle thePOW instructions. A POW instruction cannot be executed if the number ofGDESM credits is non-zero. The gateway 52 decrements the number of GDESMcredits in response to the completion of a POW instruction.

The host 63 sends an instruction to update/increment the GDISM creditsusing RDMA to send the instruction. When the streaming engine 124 isnotified via an RDMA write from host 63 of an update to the GDISMcredits register, it will update the credits register accordingly.

There is a relationship between the GDISM credits and ESP credits. AGDISM credit gives the gateway 52 an allowance to transfer data fromhost memory to gateway memory 114 for one super-step. When the gateway52 has loaded the data for this super-step into its memory 114, then itwill decrement the GDISM credits and add one credit to the ESP credits.Now, the accelerator 51 can either perform a pull for this data(including a pull according to any pull model) or the gateway 52 can doa push of the data to the accelerator 51 (a push according to any pushmodels) since the LSPM 117 and/or LSBM 118 will acknowledge the syncrequest when the number of ESP credits is >0.

Reference is made to FIG. 9, which shows an example of a system 130comprising a plurality of accelerators 131, a plurality of gateways 132and a plurality of hosts 133. Since the gateways 132 communicate withone another, collectively the gateways 132 form an Ethernet network 134.The communication between the gateways 132 enables the disaggregation ofthe accelerators and the hosts. In other words, any host 133 in thesystem 130 is able to communicate with any accelerator 131.

Although FIG. 9 shows each gateway 132 being associated with a host 133with which it communicates, in some embodiments, there is not one hostper gateway. In some embodiments, only one of the gateways 132 shown inFIG. 9 may directly communicate with a host 133. That one host 133 couldcontrol a plurality of gateways 134. The gateway coupled to the host maydistribute data from the host to the remaining gateways 134.Alternatively, the plurality of gateways 134 may retrieve data from theremote storage 151.

In the case that only one gateway 134 communicates with a host 133, thatone gateway 134 may be the only gateway 134 of the plurality of gateways134 that includes a network interface device. This has the advantage ofreducing costs, by reducing the number of components required toconstruct the remaining gateways. When the remaining gateways providedata to the host, they may first perform data preparation (e.g.augmentation) operations on the data before providing that data to thegateways comprising the network interface device for communicating withthe host.

In some embodiments, there are no external hosts 133 in the system 130,but rather the host system runs on one or more of the gateways 134. Inthis case, the compiler runs on the gateway 134.

In some examples, a gateway 132 receives data from a host 133 anddistributes this data to one or more other gateways 132. In otherexamples, a subset of gateways 132 receive data from one or more hosts133 and distribute the received data to one or more other gateways. Eachof the one or more other gateways 132 may provide the distributed datato its associated accelerator 131. By doing so not all of the gateways132 need receive data from a host 133. This method could reduce costssince, in this case, not all of the gateways need be provided with fullbandwidth. It could also improve efficiency. In some example, eachaccelerator 131 in a group of accelerators receives and processesidentical data. In this case, the data need only be fetched once from ahost 133. Therefore, a gateway 132 receives said data from the host 133and distribute copies of this data to one or more gateways 132, whichare each configured to distribute data to their associated accelerator131. Hence, efficiency gains are realised since the same data need notbe fetched from the hosts 133 multiple times. Additionally, this can becombined with the use of the remote storage 151 for retrieval of data bythe gateways. The use of the remote storage 151 for retrieval means thatthe cost reduction can be achieved and the Gateways can have fullbandwidth. A host may send storage descriptors to many gateways, whichin parallel may act on these descriptors and pull/push data from theremote storage 151 over independent network connections per gateway.This technique scales I/O as a function of the number of gateways.

In some cases, the data that is distributed from a gateway 132 to one ormore other gateways 132, is modified at the one or more other gateways132. For example, the one or more other gateways 132 applies datapreparation (e.g. augmentation) to the data to be supplied to the one ormore other gateways 132. This data augmentation is performed by theDME/s in the respective gateway/s. When each of the one or more othergateways 132 has modified the data that it has received, the data istransferred pushed to its associated accelerator 131. Gateways operatingin the push model are configured to execute DMOV instructions to pushthe data to their associated accelerator 131. Gateways operating in thepull model receive read requests from their associated accelerators sothat the data is pulled to their associated accelerator 131.

The pre-compiled gateway software specifies which accelerators 52 getwhich of the data held in memory 114 by a gateway 132 and from whichhost. The compiler of the accelerator code determines how to apportiondata between the accelerators so as to apportion work between them. Thegateway 132 load balances the I/O traffic across the two PCIe ports ithas towards each accelerator.

The gateway and accelerator layers of the system are duplicated in sucha way so as to allow for scaling of the system. Reference is made toFIG. 12, which shows an example of an apparatus 161 comprising aplurality of accelerators 162 and a plurality of gateways 163. Theapparatus 161 is referred to as a machine 161. The machine 161 comprisesfour accelerators 162 and two gateways 163. Each of the gateways 163 arealso coupled to one or more hosts (not shown).

Reference is made to FIG. 13, which shows an example of an apparatus170, comprising a plurality of machines 161 as illustrated in FIG. 12. Aplurality of machines 161 are arranged into an apparatus 171, which isreferred to as a cluster 171. Each cluster 171 comprises up to 4machines 161. A plurality of clusters 171 are arranged into an apparatus170, which is referred to as a pod 171. Each pod 171 comprises up to 32machines 161. By scaling the system in this manner, a resulting pod 171comprises 128 accelerators, resulting in system with 16 PFLops and 8 TBof DRAM.

In this model illustrated by FIGS. 12 and 13, each gateway 163 providesa low latency bridge between two or more groups of accelerators 162,allowing accelerators 162 attached to different gateways 163 tocommunicate with each other as if they were connected on the sameinternal fabric. Packets are received from an accelerator 162 at the XPUports (shown in FIG. 8) of a gateway 163. Packets which are targetingmemory space that maps to a remote accelerator are detected at the XPUPorts and directed towards the appropriate fabric port (shown in FIG. 8)of the gateway 163. The packet receives at the appropriate acceleratorport will be forwarded to the appropriate gateway. From there thegateway will forward the packet to the remote accelerator that isindicated by the memory space targeted by the packet.

Each gateway 163 includes PCIe ports. 4 of these PCIe ports areconfigured to pass packets to and from accelerators 162. Each PCIe Port(shown in FIG. 12) can be configured to use a different acceleratorspecific protocol. A custom gateway transaction layer then convertsbetween that protocol and the gateway internal protocol. The customgateway layer implements the address map, and provides collective andbroadcast/multicast offload support. Each gateway 163 provides anaddress mapping scheme, exposing all participating accelerators 162 in aglobal address space. The packets received at the gateway 163 from theaccelerator 162 contain a gateway ID, identifying the destinationgateway to which the packet is to be routed.

The global address space encompasses all accelerators 162 belonging tothe pod 170 as well as all of the gateway's 163 memory resources.Accelerators may dispatch packets specifying addresses in the globaladdress space. Some parts of the address are used to select theresources on the target gateway. Some parts of the address are used toidentify the gateway which is being addressed. Some other parts are usedto identify addresses in the gateway memory or memory in an associatedaccelerator's tile memory. The accelerator's tile memory is addressableby a tile index and a memory offset. The address may include this tileindex and memory offset to identify a location in the accelerator atwhich data of the data packet is to be stored.

When a packet is received, the identification of the gateway in theaddress is compared against this gateway's global ID. If there is amatch, the request is targeting a resource belonging to this gateway (alocal accelerator or local memory). Otherwise, the part of the addressare used to index a routing table. The contents of the routing tableindicate the target port in the system. Some bits of the address will bematched against the gateway routing table to determine where to routethe packet.

The ingress packet pipeline is intended to be a cut-through pipelinewith no buffering other than pipeline stages necessary to implement therequired features. Packets are first classified by type:multicast/broadcast, collective and unicast/Memory Writes. These arethen split out to individual blocks for processing. The gateway 52 maycomprise a unicast module for processing unicast packets and a multicastgrouping table. The unicast packet routing table is used by the gateway52 to perform routing of unicast packets, i.e. those directed to asingle accelerator. The incoming address is decoded and selected bitsare used to determine the destination. This is a two-step process: firstthe gateway ID bits are used to determine if this packet targets thisgateway. If not, then the gateway ID bits are used to index a routingtable which returns the output fabric port for this packet.

If the packet is targeting the gateway 52, then local address bits inthe packet address are used to lookup in a set of local gateway baseaddress registers (BARS) consisting of a plurality of regions, i.e. oneBAR for gateway memory and one BAR for each accelerator port. If thelocal address bits indicate that the packet is for storage in gatewaymemory, e.g. memory 114, the packet is stored in the Gateway memoryaccording to the address in the BAR for gateway memory. If the localaddress bits indicate that the packet is for delivery to theaccelerator, then the packet is forwarded to the DME 122 of the gateway52. From there the data packet may be forwarded to the acceleratoraccording to the address in the BAR for the relevant accelerator port.

Packets specifying the multicast/broadcast service are processed at themulticast group table. Each Fabric port has its own table with a list ofports which will get a copy for each group (including broadcast). Thereare three sets of destinations. Firstly, packets are sent to the localaccelerators if, and only if, the packet belongs to the same vFabric asthe Gateway. Secondly, all incoming broadcast/multicast packets arechecked against the Fabric table to see if they must be forwarded.Thirdly, a copy will be sent to local DRAM. Once the destination portvector is built, the vector and the packet are forwarded to the switchinterconnect, which provides the replication service.

The invention claimed is:
 1. A gateway for use in a computing system tointerface a host with a subsystem for acting as a work accelerator tothe host, the gateway having: an accelerator interface for connection tothe subsystem to enable transfer of batches of data between thesubsystem and the gateway; a data connection interface for connection toexternal storage for exchanging data between the gateway and storage; amemory interface connected to a local memory associated with thegateway; and a streaming engine for controlling the streaming of batchesof data into and out of the gateway, wherein the streaming of batches ofdata is selectively performed via at least one of the acceleratorinterface, data connection interface, and memory interface, wherein thestreaming engine is configured to perform data preparation processing ofthe batches of data streamed into the gateway prior to said batches ofdata being streamed out of the gateway, wherein the data preparationprocessing comprises at least one of: data augmentation; decompression;and decryption; wherein the streaming engine is further configured to:process a set of data received at the gateway to produce a plurality ofsets of data; apply data preparation operations to each of the pluralityof sets of data with different settings applied for different ones ofthe plurality of sets of data to produce a plurality of prepared sets ofdata; and cause each of the plurality of prepared sets of data to betransferred to a different one of a plurality of subsystems for actingas work accelerators to the host.
 2. A gateway as claimed in claim 1,wherein the streaming engine comprises at least one processor configuredto perform the data preparation processing.
 3. A gateway as claimed inclaim 2, wherein the at least one processor is configured to executecomputer-readable instructions stored in a memory of the gateway toperform at least some of the data preparation processing.
 4. A gatewayas claimed in claim 1, wherein the external storage is at least one of:a host; and a remote storage.
 5. A gateway as claimed in claim 1,wherein the performing data preparation processing of the batches ofdata comprises performing data preparation processing of data receivedfrom the external storage prior to said data being provided by thegateway to the subsystem.
 6. A gateway as claimed in claim 1, whereinthe performing data preparation processing of the batches of datacomprises performing data preparation processing of data streamed intothe gateway prior to said data being provided by the gateway to at leastone second gateway.
 7. A gateway as claimed in claim 1, wherein theperforming data preparation processing of the batches of data comprisesperforming data preparation processing of data received from at leastone second gateway prior to said data being streamed out of the gateway.8. A gateway as claimed in claim 1, wherein the processing the set ofdata received at the gateway to produce the plurality of sets of datacomprises at least one of: replicating the received set of data, whereineach of at least some of the plurality of sets of data is a copy of thereceived set of data; and sharding the received set of data, whereineach of at least some of the plurality of sets of data is a subset ofthe received set of data.
 9. A gateway as claimed in claim 1, whereinthe accelerator interface is configured to connect the gateway to atleast some of the plurality of subsystems to enable transfer of batchesof data between the gateway and the at least some of the plurality ofsubsystems, wherein the causing each of the plurality of prepared setsof data to be transferred to different ones of the plurality ofsubsystems comprises providing at least one of the prepared sets of datato the accelerator interface to be transferred to the at least some ofthe plurality of subsystems.
 10. A gateway as claimed in claim 1,wherein the causing of each of the plurality of prepared sets of data tobe transferred to different ones of the plurality of subsystemscomprises providing at least one of the prepared sets of data to agateway interface to be transferred to at least one second gateway, theat least one second gateway being configured to interface with at leastone of the plurality of subsystems.
 11. A gateway as claimed in claim 1,wherein applying the data preparation operations with different settingsapplied comprises applying different types of data augmentation.
 12. Agateway as claimed in claim 1, wherein applying the data preparationoperations with different setting applied comprises applying the sametype of data augmentation with different parameters for theaugmentation.
 13. A gateway as claimed in claim 1, wherein the streamingengine comprises at least one hardware module configured to perform atleast some of the data preparation processing of the data.
 14. A gatewayas claimed in claim 13, wherein the at least one hardware modulecomprises a plurality of hardware modules each of which is configured toperform a different type of data preparation processing.
 15. A gatewayas claimed in claim 13, wherein the at least one hardware modulecomprises at least one field programmable gate array configured toperform the data preparation processing of the data.
 16. A gateway asclaimed in claim 15, comprising a processor configured to executecomputer-readable instructions stored in a memory of the gateway toprovide a runtime support configured to program the at least one fieldprogrammable gate array to add data preparation operations to beperformed by the at least one field programmable gate array.
 17. Amethod of interfacing a gateway with a work accelerator for a hostsystem, the gateway comprising: an accelerator interface for connectionto the work accelerator to enable transfer of data between the workaccelerator and the gateway; a data connection interface for connectionto external storage for exchanging data between the gateway and storage;a memory interface connected to a local memory associated with thegateway, the method comprising: controlling the streaming of data intoand out of the gateway, including selecting one or a combination of theaccelerator interface, data connection interface, and memory interfacefor the streaming; wherein controlling the streaming includes:processing a set of data received at the gateway to produce a pluralityof sets of data; applying data preparation operations to each of theplurality of sets of data with different settings applied for differentones of the plurality of sets of data to produce a plurality of preparedsets of data; and causing each of the plurality of prepared sets of datato be transferred to a different one of a plurality of subsystems foracting as work accelerators to the host system.
 18. The method of claim17, wherein the data preparation operations comprise an item selectedfrom the list consisting of: data augmentation, decompression, anddecryption.
 19. A computer program comprising a set of computer readableinstructions stored on a non-transitory media which when executed by aprocessor of a gateway, the gateway including an accelerator interfacefor connection to a work accelerator to enable transfer of data betweenthe work accelerator and the gateway, a data connection interface forconnection to external storage for exchanging data between the gatewayand the external storage, and a memory interface connected to a localmemory associated with the gateway, causes the gateway to: stream datainto the gateway; process the data streamed into the gateway to producea plurality of sets of data; apply data preparation operations to eachof the plurality of sets of data with different settings applied fordifferent ones of the plurality of sets of data to produce a pluralityof prepared sets of data; and stream data out of the gateway, includingselecting one or a combination of the accelerator interface, the dataconnection interface, and the memory interface for streaming out of thegateway, wherein streaming data out of the gateway includes streamingeach of the prepared sets of data out of the gateway to a different oneof a plurality of subsystems for acting as work accelerators to a hostsystem.